无法运行我的应用程序,我的错误是:app:compileDebugJavaWithJavac

时间:2018-12-08 09:03:38

标签: react-native

我运行“ react-native run-android”,但失败了,这张照片是我的结果

我的build.gradle是:我认为这是正确的但不起作用

enter code here
repositories {
    jcenter()
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
}}allprojects {
repositories {
 google()
    mavenLocal()
    jcenter()
    flatDir() {
     dirs 'libs'
     }
    maven {
        url "$rootDir/../node_modules/react-native/android"
    }
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
}

和app / build.gradle是

 compileSdkVersion 28
    buildToolsVersion '28.0.3'

defaultConfig {
    applicationId "ir.yana.sample"
    minSdkVersion 16

    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }

谢谢

imagesy

1 个答案:

答案 0 :(得分:0)

将buildToolsVersion升级到“ 28.0.3” compileSdkVersion 28 buildToolsVersion '28.0.3' 然后同步gradle。希望对您有用。