Gradle同步失败:向后分支上存在未初始化的对象70

omqzjyyz  于 9个月前  发布在  其他
关注(0)|答案(4)|浏览(119)

我的android应用无法同步gradle,构建日志中出现以下错误:

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)

字符串
以下是我的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'


我很乐意提供更多的信息,如果你需要。

e3bfsja2

e3bfsja21#


要永久解决该问题,请转到模块设置> SDK位置>使用嵌入式JDK。
这将通过使用嵌入式JDK消除对外部Java安装的依赖性。

p5fdfcr1

p5fdfcr12#

Android Studio:3.5.3
Gradle插件:3.5.3
Gradle:5.4.1
平台:Mac OS莫哈韦10.14.6(18 G103)
我已经这样做了:项目结构-> SDK位置->选择“使用嵌入式JDK(推荐)”,但它仍然不工作。
当我读到这篇文章时,
您可以在gradle.properies添加属性:

org.gradle.java.home=(JDK home的路径)

成功了!

oogrdqng

oogrdqng3#

我在android studio android平台,Flutter和Unity中也遇到了同样的错误。对我来说,出问题的是我使用了外部JDK 1.8版本(而不是嵌入式版本),它是一个破碎的版本。
然后我从Oracle站点安装了JDK-8 u202-windows-x64. exe。
在那之后,就像他们在上面的回答中提到的那样设置那个版本。它对我来说非常有效。

nwlls2ji

nwlls2ji4#

我无法找到在Android Studio Jirafe中使用嵌入式JDK
所以我去设置->构建,执行,部署
在GradleSDK中:下载JDK,我选择了correcto-1.8 Amazon correcto version 1.8.0_392
x1c 0d1x的数据

相关问题