React Native:compileDebugJavaWithJavac FAILED用于

时间:2019-07-17 17:26:53

标签: android android-studio react-native react-native-android

我不断收到错误消息 我所有模块上的Demo\Sprites\cookie.png。起初,我以为只是AppSee,但它在我所有的模块中都存在。

我已经尝试过更新Gradle,并确保我的所有版本都可以满足我的依赖关系?

这是我的应用程序文件,缩减为重要部分

compileDebugJavaWithJavac FAILED

这是错误:

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "com.kalleonative"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 10
        versionName "1.1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

...
dependencies {
    compile project(':react-native-contacts')
    compile project(':react-native-vector-icons')
    compile project(':react-native-firebase-analytics')
    compile project(':react-native-fbsdk')
    compile project(':react-native-push-notification')
    compile ('com.google.android.gms:play-services-gcm:10.0.1') {
        force = true
    }
    compile project(':react-native-config')
    compile fileTree(dir: "libs", include: ["*.jar"])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-annotations:28.0'
    compile "com.facebook.react:react-native:0.6.0"  // From node_module
    compile 'com.twilio:voice-android:2.0.0-beta14'
    //noinspection GradleCompatible
    compile 'com.android.support:design:28.0.0'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.koushikdutta.ion:ion:2.2.1'
    compile 'com.google.firebase:firebase-messaging:19.0.1'
    compile 'com.segment.analytics.android:analytics:4.4.0-beta1'
    compile project(':react-native-immediate-phone-call')
}

1 个答案:

答案 0 :(得分:0)

当我在项目中添加“ react-native-contacts”时,我遇到相同的问题。由于“ react-native-contacts”现在支持AndroidX,因此您必须:

  1. 将您的项目迁移到AndroidX。 https://developer.android.com/jetpack/androidx/migrate
  2. 使用Jetifier将node_modules依赖项转换为AndroidX。 https://github.com/mikehardy/jetifier#usage-for-source-files

尝试一下!