0

I made an android application in which using API 23 does not have any problem.

Current Code using API 23:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.example.hasani.bluetoothterminal"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 4
    versionName "1.3"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}  }

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0' }

But when I set targetSdkVersion to 25 just like below, it shows me error with compiler not found.

apply plugin: 'com.android.application'

 android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "com.example.hasani.bluetoothterminal"
minSdkVersion 15
targetSdkVersion 25
versionCode 4
versionName "1.3"
}
buildTypes {
release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}  }

 dependencies {
 compile fileTree(dir: 'libs', include: ['*.jar'])
 compile 'com.android.support:appcompat-v7:25.2.0'
 compile 'com.android.support:appcompat-v7:25.2.0' }

I have tried to update android studio to 2.2.3, but after downloading the patch file it showed be a list of conflicts in gradle 2.8. Any help would be appreciated. Thank You!

Nair123
  • 1
  • 4
  • 1
    Most likely you don't have the 7.1 platform installed, check your SDK manager – Rafael Francisco Mar 01 '17 at 10:34
  • Could you provide us with the complete error message? – Guido Mar 01 '17 at 10:38
  • @RafaelFrancisco Ok thanks. I am able to sync but when I go for "Build APK" it gives me error. – Nair123 Mar 01 '17 at 10:40
  • @Guido Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_04\bin\java.exe'' finished with non-zero exit value 1 – Nair123 Mar 01 '17 at 10:41
  • @Guido Its giving me warning like .................................................................................Warning:C:\Users\U17Z18\AppData\Local\Android\android-sdk\platforms\android-25\android.jar(java/io/InputStream.class): major version 52 is newer than 51, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. – Nair123 Mar 01 '17 at 10:43
  • I think [this](http://stackoverflow.com/a/32811133/4653908) might solve your problem. – Guido Mar 01 '17 at 10:45
  • @Guido Warning has gone but now the error is...................................................................................................................Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_04\bin\java.exe'' finished with non-zero exit value 1 – Nair123 Mar 01 '17 at 10:52
  • @Guido While running the app in my phone, its giving me an exception and its crashing,..............................................IllegalStateException - configure your build for VectorDrawableCompat at MainActivity.onCreate(MainActivity) i.e; in super.onCreate(savedInstanceState) – Nair123 Mar 01 '17 at 11:00
  • Try adding this: compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } – Guido Mar 01 '17 at 11:05
  • 1
    @Guido Thanks for the help buddy! I solved the problem. Firstly, I downloaded the packages in SDK manager. Then I was able to sync the project, but was not able to run in my phone. Then I added multidex to true in build.gradle file. The app was running but crashing. Then I thought to upgrade the gradle to 2.10 by updating in gradle-wrapper.properties file and then syncing in Android Studio. Well now everything is fine. Thanks a lot buddy! – Nair123 Mar 01 '17 at 11:31

0 Answers0