2015年12月16日 星期三

Install fail: Failure [INSTALL_FAILED_OLDER_SDK] for KitKat device

Reference:

https://www.reddit.com/r/androiddev/comments/297xli/howto_use_the_v21_support_libs_on_older_versions/
http://moonlightbox.logdown.com/posts/2015/09/01/android-finished-with-non-zero-exit-value-3
http://stackoverflow.com/questions/31605291/gradle-finished-with-non-zero-exit-value-3
https://www.dotblogs.com.tw/newmonkey48/2015/11/02/153771

Steps:


1. Change minSdkVersion to 19 (for KitKat) in all build.gradle files
2. If Studio show some error messages like below one, you can add dexOptions in the app/build.gradle to fix the error.
Error message:
java.lang.OutOfMemoryError: GC overhead limit exceeded​

Error:org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_67\bin\java.exe'' finished with non-zero exit value 3

Solution:
app/build.gradle

android {
   ............
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

沒有留言: