Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gradle 配置';编译';这是过时的。替换为实现后给出错误_Gradle_Build.gradle - Fatal编程技术网

Gradle 配置';编译';这是过时的。替换为实现后给出错误

Gradle 配置';编译';这是过时的。替换为实现后给出错误,gradle,build.gradle,Gradle,Build.gradle,我正在运行一个现有项目,只是需要一些帮助来更新现有项目的应用程序级别build.gradle。当我用实现替换关键字compile时,它对我不起作用。此外,我在gradle-wrapper.properties中使用“gradle-6.1.1-all.zip”,在另一个build.gradle中使用classpath'com.android.tools.build:gradle:4.0.0'。以及如何替换其他firebase依赖项 dependencies { compile projec

我正在运行一个现有项目,只是需要一些帮助来更新现有项目的应用程序级别build.gradle。当我用实现替换关键字compile时,它对我不起作用。此外,我在gradle-wrapper.properties中使用“gradle-6.1.1-all.zip”,在另一个build.gradle中使用classpath'com.android.tools.build:gradle:4.0.0'。以及如何替换其他firebase依赖项

dependencies {
    compile project(':realm')
    compile project(':react-native-vector-icons')
    compile project(':react-native-lock')
    compile project(':react-native-firebase')
    implementation project(':realm')
    implementation project(':react-native-vector-icons')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:28.0.0"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation project(':react-native-firebase')

    // Firebase dependencies
    implementation "com.google.android.gms:play-services-base:15.0.1"
    implementation "com.google.firebase:firebase-core:16.0.1"
    implementation "com.google.firebase:firebase-database:16.0.1"
    implementation "com.google.firebase:firebase-auth:16.0.2"
    implementation "com.google.firebase:firebase-messaging:17.1.0"
    implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
}
以下是终端上的错误

problem occurred configuring project ':react-native-lock'.
> Could not resolve all artifacts for configuration ':react-native-lock:classpath'.
   > Could not download gradle-core-1.3.1.jar (com.android.tools.build:gradle-core:1.3.1)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.1/gradle-core-1.3.1.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.1/gradle-core-1.3.1.jar'.
            > Connection reset
   > Could not download lint-24.3.1.jar (com.android.tools.lint:lint:24.3.1)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.1/lint-24.3.1.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.1/lint-24.3.1.jar'.
            > jcenter.bintray.com
   > Could not download dvlib-24.3.1.jar (com.android.tools:dvlib:24.3.1)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/dvlib/24.3.1/dvlib-24.3.1.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/dvlib/24.3.1/dvlib-24.3.1.jar'.
            > Connection reset
   > Could not download common-24.3.1.jar (com.android.tools:common:24.3.1)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/common/24.3.1/common-24.3.1.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/common/24.3.1/common-24.3.1.jar'.
            > Connection reset
   > Could not download bcpkix-jdk15on-1.48.jar (org.bouncycastle:bcpkix-jdk15on:1.48)
      > Could not get resource 'https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar'.
            > Connection reset
   > Could not download bcprov-jdk15on-1.48.jar (org.bouncycastle:bcprov-jdk15on:1.48)
      > Could not get resource 'https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar'.
            > No such host is known (jcenter.bintray.com)
   > Could not download asm-analysis-5.0.3.jar (org.ow2.asm:asm-analysis:5.0.3)
      > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar'.
            > jcenter.bintray.com
   > Could not download asm-tree-5.0.3.jar (org.ow2.asm:asm-tree:5.0.3)
      > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar'.
            > jcenter.bintray.com
   > Could not download asm-5.0.3.jar (org.ow2.asm:asm:5.0.3)
      > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar'.
            > jcenter.bintray.com
   > Could not download jack-api-0.9.0.jar (com.android.tools.jack:jack-api:0.9.0)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.jar'.
            > jcenter.bintray.com
   > Could not download jill-api-0.9.0.jar (com.android.tools.jill:jill-api:0.9.0)
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.jar'.
            > jcenter.bintray.com
   > Could not download ecj-4.4.2.jar (org.eclipse.jdt.core.compiler:ecj:4.4.2)
      > Could not get resource 'https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar'.
            > jcenter.bintray.com
   > Could not download proguard-base-5.2.1.jar (net.sf.proguard:proguard-base:5.2.1)
      > Could not get resource 'https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar'.
            > jcenter.bintray.com

Gradle正在尝试从jcenter访问文件,但没有成功。我认为这与gradle或api/实现的使用(相对于编译)无关


您是否访问日志中提供的URL?我建议您检查连接状态/代理状态/…或重试。它应该可以工作。

好的,但是现在它在以下行中也给出了构建错误:无法确定任务的依赖项:“:app:compiledBugJavaWithJavaC”。>无法解析配置“:app:debugCompileClasspath”的所有任务依赖项。请尝试使用
api
而不是
compile