简体   繁体   English

React-native项目中的Gradle @aar依赖关系解析

[英]Gradle @aar dependency resolution in react-native project

I'm using an @aar dependency with transitive=true in build.gradle . 我使用的是一个@aar依赖transitive=truebuild.gradle It's downloaded to the gradle cache, but isn't resolved while the app is being compiled. 它已下载到gradle缓存中,但在编译应用程序时未解决。

It may or may not be relevant, but I'm using it in a react-native app. 它可能相关,也可能不相关,但我正在React-native应用程序中使用它。 The other dependencies in the build are compiled without a problem. 编译中的其他依赖项不会出现问题。

Does anyone have experience dealing with this type of issue? 有没有人有处理此类问题的经验?

I figured out that it was a react-native issue. 我发现这是一个反应性问题。 If you are loading a @aar dependency in a package you also need to declare it as a repository in android/build.gradle in the block 如果要在程序包中加载@aar依赖项,则还需要在块中的android/build.gradle中将其声明为存储库

allprojects {
  repositories {
    mavenLocal()
    jcenter()
    DESIRED_REMOTE_REPO_HERE
  }
}

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM