Join with us

[SOLVED] Mismached Encoding in Android Studio 1.2.2

CLICKTECHNO - Hello my friends, these day --couple hours ago-- when I had an new update of Android Studio I going install it, but then problem came out. The problem is when i open my last project out error if my project encoding does not macth with regullar encoding which used in android studio (UTF-8).

If you are using to update your Android Studio to 1.2.2 then you must have this problem too. The encoding used to compile your project is specified in the build.gradle files. The default, which is used when no specific encoding is specified, is UTF-8. I strongly recommend you use UTF-8 encoding whenever possible. This is because the Android development tools create UTF-8 encoded projects by default, the Android Gradle plugin uses UTF-8 by default, and Android Lint will warn whenever it encounters XML files that are not using UTF-8, for example.

The different of the endcoding can make a serious bug came out, however your project can be build like usually it must do.

If you are want fix the mismached, you can find it in File --> File Encodings.
android {
    ...
    compileOptions {
        encoding "UTF-8"
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}
ps: the version of jdk must be mach to with your config, if you are using jdk 1.7 then just like that but if you use jdk 1.8 then you must change it with VERSION_1_8
Afterthat do not forget to save the file and then re-sync your gradle project, and then wala your error are gone.

I hope you enjoy this tips from us.


[SOLVED] Mismached Encoding in Android Studio 1.2.2 [SOLVED] Mismached Encoding in Android Studio 1.2.2 Reviewed by Izuka on Friday, July 03, 2015 Rating: 5
Powered by Blogger.