0

My Gradle

compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
    applicationId "com.tester.us_site"
    minSdkVersion 17
    //noinspection GradleCompatible
    targetSdkVersion 26
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

After compilation, I get this error

Information:Gradle tasks [:app:assembleDebug]
Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: org.gradle.tooling.BuildException: com.android.dx.cf.code.SimException: default or static interface method used without --min-sdk-version >= 24
Information:BUILD FAILED in 40s
Information:1 error
Information:0 warnings
Information:See complete output in console

As I understand, this error says that in order to run the project it is necessary to specify min sdk 26.

But what about Android 5.0 6.0 7.0?

## Gradle Build ##
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta1'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Prost
  • 169
  • 1
  • 7
  • 1
    Update your class path in gradle.build in project level. – aslamhossin Aug 10 '17 at 16:33
  • @AslamHossin, Can be more. And then I did not understand something – Prost Aug 10 '17 at 16:37
  • 1
    just remove both 'build' folder in /android and /android/app and build again with 'react-native run-android' – aslamhossin Aug 10 '17 at 16:44
  • I did as you said, after the synchronization was done and still this error appeared – Prost Aug 10 '17 at 16:49
  • 1
    Last thing you can try by editing like this : compile group: 'com.neenbedankt.gradle.plugins', name: 'android-apt', version: '1.8' https://stackoverflow.com/questions/33149648/cannot-get-android-apt-working – aslamhossin Aug 10 '17 at 16:54

2 Answers2

1

You can try to upgrade it to the latest android-specific build

implementation 'com.google.guava:guava:23.0-android'

This fixed the error for me

Diego Plentz
  • 6,760
  • 3
  • 30
  • 31
0

I Change Guava 21 on 22. and add force 'com.google.code.findbugs:jsr305:1.3.9'

This is working. All thx))

Prost
  • 169
  • 1
  • 7
  • For me it was the use of Jackson-datatype-jsr310. I finally gave up on trying to use the java.time api in android. I guess its time to bring joda back to my project. As soon as I commented this line -> compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.0' my project started compiling using compileSdkVersion 26 and Android studio 3.0 beta2. – 1vand1ng0 Aug 16 '17 at 16:02