Sithu
Sithu

Reputation: 4862

Gradle sync failed: Uninitialized object exists on backward branch 70

My android app failed to sync gradle with the following error in build log:

Uninitialized object exists on backward branch 70
Exception Details:
  Location:
    com/android/build/gradle/tasks/BuildArtifactReportTask.newArtifact(Lcom/android/build/api/artifact/BuildableArtifact;)Lcom/android/build/gradle/tasks/BuildArtifactReportTask$BuildableArtifactData; @119: goto
  Reason:
    Error exists in the bytecode
  Bytecode:
    0000000: bb00 f459 2bb9 0139 0100 c000 6b2b b901
    0000010: 3d01 0001 b901 4302 0059 1301 45b8 0148
    0000020: c000 374d 3a0d 3a0c 3a0b 2c4e bb00 6859
    0000030: 2c10 0ab8 003d b700 69c0 006b 3a04 2db9
    0000040: 0054 0100 3a05 1905 b900 5a01 0099 002d
    0000050: 1905 b900 5e01 003a 0619 0419 06c0 014a
    0000060: 3a07 3a0e 1907 b901 4d01 003a 0f19 0e19
    0000070: 0fb9 0075 0200 57a7 ffcf 1904 c000 773a
    0000080: 0e19 0b19 0c19 0d19 0eb7 0150 b0       
  Stackmap Table:
    full_frame(@70,{Object[#2],Object[#109],Object[#55],Object[#55],Object[#107],Object[#86],Top,Top,Top,Top,Top,Uninitialized[#0],Uninitialized[#0],Object[#107]},{})
    same_frame(@122)

Here is my build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.3'

    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 111
        versionName "1.1.1"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(":adjust")
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.squareup.okhttp:okhttp:2.0.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.google.firebase:firebase-core:11.0.1'
    compile 'com.google.firebase:firebase-messaging:11.0.1'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

I'm happy to provide more information if you need.

Upvotes: 6

Views: 6654

Answers (4)

Noe Miranda Franco
Noe Miranda Franco

Reputation: 83

i could not find use embedded JDK in android studio Jirafe

so i went to Settings-> Build, execution, deployment

in GradleSDK: Dowload JDK and i selected correcto-1.8 Amazon correcto version 1.8.0_392

enter image description here

Upvotes: 0

Lasitha Lakmal
Lasitha Lakmal

Reputation: 880

I got the same error in the android studio android platform, Flutter and Unity as well. What went wrong for me was that I used an external JDK 1.8 version (Not the embedded version) and it was a broken version.

then I installed JDK-8u202-windows-x64.exe from the oracle site.

and after that set that version as they mention in the above answers. It worked perfectly for me.

Upvotes: 0

user9939900
user9939900

Reputation:

enter image description here to solve that problem permanently, go to Module Settings > SDK Location > Use embedded JDK.

This will remove dependency on the external Java installation by using the embedded JDK.

Upvotes: 9

Blues
Blues

Reputation: 93

Android Studio: 3.5.3
gradle plugin: 3.5.3
gradle: 5.4.1
platform: Mac OS Mojave 10.14.6 (18G103)

I had done this:Project Structure -> SDK Location -> Select "Use embedded JDK(recommended)" but it still not working.

when I read this article,

you can add a property at gradle.properies:

org.gradle.java.home=(path to JDK home)

it works!

Upvotes: 2

Related Questions