简体   繁体   English

React-Native Android - 找不到com.android.tools:common

[英]React-Native Android - Could not find com.android.tools:common

It seems that somehow the android/tools/common library has been deleted ( pom , jar ). 似乎不知何故android/tools/common库已被删除( pomjar )。

This caused many react native libraries that are using an old gradle version in their classpath (eg com.android.tools.build:gradle:2.2.3 ) to not being able to sync 这导致许多反应原生库在其类路径中使用旧的gradle版本(例如com.android.tools.build:gradle:2.2.3 )无法同步

How can i fix it? 我该如何解决?

Update , I had to add more code to build.gradle 更新 ,我不得不为build.gradle添加更多代码

This is my fix, I did not fork repos just used this workaround: add this to your build.gradle file, the sibling of settings.gradle file 这是我的修复,我没有使用这个解决方法的fork repos:将它添加到你的build.gradle文件, settings.gradle文件的兄弟

buildscript {
  repositories {
     google()
     jcenter { url "http://jcenter.bintray.com/"}
     maven { url "https://dl.bintray.com/android/android-tools" }
  }
}

subprojects { project ->
  def name = project.name
  if (name.contains('module name, e.g. react-native-blur')
        || name.contains('other module name, e.g. react-native-image-picker')) {
    buildscript {
        repositories {
            maven { url "https://dl.bintray.com/android/android-tools/"  }
        }
    }
  } 
}

In my build.gradle file (of the project not the app) i've added the new bintray url first but also had to add all the others after: 在我的build.gradle文件(项目不是应用程序)中,我首先添加了新的bintray网址,但也必须在之后添加所有其他网址:

subprojects {
    buildscript {
        repositories {
            maven { url 'https://dl.bintray.com/android/android-tools' }
            google()
            mavenLocal()
            jcenter()
        }
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到com.android.tools:common:25.2.3 - Could not find com.android.tools:common:25.2.3 找不到 com.android.tools:r8:1.5.25 - Could not find com.android.tools:r8:1.5.25 react-native运行android找不到com.android.tools.build:gradle:3.0.1 - react-native run-android Could not find com.android.tools.build:gradle:3.0.1 React-native 项目构建失败:找不到 com.android.tools.lint ,无法确定任务 ':app:lintVitalRelease' 的依赖关系 - React-native project Build failed: Could not find com.android.tools.lint , Could not determine the dependencies of task ':app:lintVitalRelease' 无法解析com.android.tools.build:gradle:3.1.4,react-native run-android - Could not resolve com.android.tools.build:gradle:3.1.4, react-native run-android React-native项目构建失败:找不到com.android.tools.lint:lint-gradle:26.1.0 - React-native project Build failed: Could not find com.android.tools.lint:lint-gradle:26.1.0 无法运行现有的Android Project com.android.tools:common:25.3.3 - Cannot run existing Android Project com.android.tools:common:25.3.3 更新后的Gradle错误:com.android.tools:sdk-common - Gradle error after update: com.android.tools:sdk-common 发布React-Native Android应用:找不到com.android.support:multidex-instrumentation:27.1.1 - Release React-Native Android app: Could not find com.android.support:multidex-instrumentation:27.1.1 “npx react-native init client”在执行时在 Android 上失败。 找不到工具。jar。 反应原生 0.62.2 - “npx react-native init client” fails on Android while executing. Could not find tools.jar. React Native 0.62.2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM