Invalid r class path shown in problem 1:mainactivity.java
Workaround: As does not automatically generate R files for some reason. For example, if the project relies on a library file version that does not match the specified compilesdkversion, you need to manually specify the version number of the library file that needs to be compiled. For example, Android.compilesdkversion is 19, then add at the end of Project->app->build.gradle
dependencies {
Compile ' com.android.support:support-v4:+ ' changed to compile ' com.android.support:support-v4:19.+ '
Compile ' com.android.support:appcompat-v7:+ ' changed to compile ' com.android.support:appcompat-v7:19.+ '
}
Note dependencies{} and android{} siblings
Issue two: As code in the edit window and run time, Chinese display garbled
Solution: As the Code editing window garbled, only need to change the lower right corner of the IDE UTF-8 to GBK; runtime display garbled, 1, add compileoptions.encoding = "in Project->app->build.gradle GBK ". 2, can not be directly input in the layout file in Chinese, need to register in the R file, such as <activity android:label= "Chinese" > Changed to <activity android:label= "@string/chinese" Add <string name= "Chinese" > Chinese </string> in Strings.xml.