Very often, when I look at the git diff
output for my Android app built with Android Studio, I see the following. Sometimes it is changing languageLevel
from JDK_1_7
to JDK_1_8
. Other times it is changing languageLevel
from JDK_1_8
to JDK_1_7
. Why so much indecision??
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -24,7 +24,7 @@
</value>
</option>
</component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
1) Add this to your app build.gradle
(inside the android
element)
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2) Exclude the .idea
folder from Git adding this to your project level .gitignore
# Ignore idea folder
.idea/
then you need to refresh your versioned files following something like this
Versioning the
.idea
folder it's useful only to share some AS settings with your team, if you are working alone or if you don't have shared coding policies you can remove it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With