react-native :app:preReleaseBuild > Resolve dependencies of :app:releaseCompileClasspath > maven-met

react-native打包的时候一直卡在

:app:preReleaseBuild > Resolve dependencies of :app:releaseCompileClasspath > maven-metadata.xml

尝试解决办法

一、打包过程种有看到会加载一些Google文件,所以尝试打开了VPN,但是最后却报错

Error:Could not resolve all files for configuration ':app:debugCompileClasspath'

如果报这个错可以在项目>android>build.gradle添加如下代码

#未添加之前的代码
allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io" }
    }
}
#添加之后的代码
allprojects {
    repositories {
        google()
        jcenter {url "http://jcenter.bintray.com/"}
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io" }
    }
}

来源:https://stackoverflow.com/questions/47716783/errorcould-not-resolve-all-files-for-configuration-appdebugcompileclasspath

二、如果没有VPN的话,请尝试重复上面的步骤

猜你喜欢

转载自blog.csdn.net/WANG_CA/article/details/91412951
今日推荐