sourcey / materiallogindemo

Android login and signup demo with material design
http://sourcey.com/beautiful-android-login-and-signup-screens-with-material-design/
833 stars 633 forks source link

Multiple Issues with Android Studio #17

Open pmcg86 opened 5 years ago

pmcg86 commented 5 years ago

Using Android Studio 3.2.1

When importing the project i'm getting "No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android"

When that is fixed it gives you a "Could not find com.android.tools.lint:lint-gradle:26.1.2." issue.

After fixing these i run into Render Problems: Couldn't resolve resource @string/path_password_strike_through - This seems to be an issue with every input box. The issue is to do with android.support.design.widget.TextInputLayout. I have to apply the below lines of code to each the XMLs and each label xmlns:tools="http://schemas.android.com/tools

app:passwordToggleDrawable="@string/path_password_strike_through app:hintTextAppearance="@style/TextAppearance.App.TextInputLayout.

Furthermore, the main issue that won't allow the project to be build is "failed to instantiate one or more classes"

The following classes could not be instantiated: - android.support.design.widget.TextInputLayout (Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE. If this is an unexpected error you can also try to build the project, then manually refresh the layout. Exception Details java.lang.NullPointerException   at android.content.res.Resources_Delegate.getDrawable(Resources_Delegate.java:189)   at android.content.res.Resources.getDrawable(Resources.java:827)   at android.content.Context.getDrawable(Context.java:626)   at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:358)   at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:198)   at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:186)   at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)   at android.support.v7.widget.TintTypedArray.getDrawable(TintTypedArray.java:75)   at android.support.design.widget.TextInputLayout.(TextInputLayout.java:241)   at android.support.design.widget.TextInputLayout.(TextInputLayout.java:187)   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)   at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)   at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)   at android.view.LayoutInflater.inflate(LayoutInflater.java:515)   at android.view.LayoutInflater.inflate(LayoutInflater.java:394)

Any solutions to get around these issues? When importing I've not updated anything that Android Studio has asked me to, except for updated the gradle wrapper to 4.4 and the gradle build to 3.1.3 to get it synced.

If you need any other details i can provide them as i would love to use this design in my Uni project

ChampionTej05 commented 5 years ago

Hey, I have found solution to this Issue, I have also undergone through the same. Problem is relatively different gradle, and Butterknife Library. I have just downloaded the Gradle as it was mentioned and changed few code related to Butterknife Library. Here are the fixes:

  1. Remove the Dependency in app module Gradle File.

    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
  2. Remove the Same from build.gradle file of Project classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'

  3. Remove the Import Statements from Login Activity and Sign Up activity related to Butterknife. Where ever "@BindView" is used just remove that and go with normal declaration of UI widgets, like we do ex:

    
    **Declaration outside the activity**
    @BindView(R.id.input_email) EditText _emailText;
    @BindView(R.id.input_password)  EditText _passwordText;
    @BindView(R.id.btn_login) Button _loginButton;
    @BindView(R.id.link_signup ) TextView _signupLink;

Statement Inside the Activity ButterKnife.bind(this);

to 

Declaration outside the activity EditText _emailText; EditText _passwordText; Button _loginButton; TextView _signupLink;

Statement Inside the Activity _emailText=findViewById(R.id.input_email); _passwordText=findViewById(R.id.input_password); _loginButton=findViewById(R.id.btn_login); _signupLink=findViewById(R.id.link_signup);



5. Do this same thing for the Signup Activity also. 
I Hope that this would help you. If you need the updated gradle file, then I will share the same.

![image](https://user-images.githubusercontent.com/41873401/53119789-41ed6200-3576-11e9-8b1a-6ec18cd390ca.png)
![image](https://user-images.githubusercontent.com/41873401/53119827-57628c00-3576-11e9-8627-30c5765d1bde.png)