简体   繁体   English

无法建立Android应用程式react-native-vector-icons:releaseCompileClasspath

[英]Can not build android app react-native-vector-icons:releaseCompileClasspath

I use react-native-vector-icons with react-native-elements 我将react-native-vector-icons与react-native-elements一起使用

The problem is that when I debug my app icons do not show up, and if I try to build release .apk I get : 问题是,当我调试我的应用程序图标时不会显示,并且如果我尝试构建release .apk,我会得到:

FAILURE: Build failed with an exception. 失败:构建失败,发生异常。

What went wrong: Could not resolve all files for configuration ':react-native-vector-icons:releaseCompileClasspath'. 出了什么问题:无法解析配置':react-native-vector-icons:releaseCompileClasspath'的所有文件。 Could not find common.jar (android.arch.lifecycle:common:1.1.0). 找不到common.jar(android.arch.lifecycle:common:1.1.0)。 Searched in the following locations: https://jcenter.bintray.com/android/arch/lifecycle/common/1.1.0/common-1.1.0.jar Could not find common.jar (android.arch.core:common:1.1.0). 在以下位置搜索: https ://jcenter.bintray.com/android/arch/lifecycle/common/1.1.0/common-1.1.0.jar找不到common.jar(android.arch.core:common: 1.1.0)。 Searched in the following locations: https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar 在以下位置搜索: https : //jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

ok, the solution to this was ... funny 好的,解决这个问题的方法很有趣

when you run build, build script must be downloaded from a repo, so the solution is to change URL/repo ur using when building 运行构建时,必须从存储库下载构建脚本,因此解决方案是更改构建时使用的URL /存储库

1 - open android/build.gradle and node_modules/react-native-vector-icons/android/build.gradle 2 - in both files u shall see jcenter() function that gives URL to repo, 3 - to solve the problem, place google() function above jcenter() in both files(in repositories section, and in allprojects section of android/build.graddle) 1-打开android / build.gradle和node_modules / react-native-vector-icons / android / build.gradle 2-在两个文件中,您都应该看到jcenter()函数,该URL给出了要回购的URL,3-解决问题,放置两个文件中(位于存储区部分和android / build.graddle的allprojects部分中)jcenter()上方的google()函数

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

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