我昨天創建了構建,它作業正常。但是當我今天嘗試創建發布版本時,我得到了這個。
The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':react-native-community_masked-view:verifyReleaseResources'.
> Could not resolve all task dependencies for configuration ':react-native-community_masked-view:releaseRuntimeClasspath'.
> Could not resolve com.facebook.react:react-native: .
Required by:
project :react-native-community_masked-view
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Read timed out
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2m 45s
5 actionable tasks: 5 up-to-date
我認為這個問題是由于 jcenter deprecation 造成的。jcenter 的任何可能的解決方案或替代方案。這適用于有許多依賴項并且您必須更改的 react-native 專案。
uj5u.com熱心網友回復:
從幾個小時的研究中,如果最終發現。這是一個問題,因為 jcenter 已關閉。根據 [official documentation][1] jcenter deprecated,Bintray/JCenter users should start migrating to a new hosting solution.
解決方案是從中洗掉 jcenterbuild file并將其替換為
mavenCentral() // <- add it
對于 react-native 用戶jcenter(),可能存在您最近安裝的某些依賴項。檢查 jcenter 打開您的專案以輕松android-studio檢查所有build.gradle檔案。
另一個解決方案是斷開您的系統與互聯網的連接并構建您的專案。在您啟動專案后,將您的系統重新連接到互聯網。[1]:https ://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
uj5u.com熱心網友回復:
jcenter 已關閉,因此在它上線之前,臨時解決方案只是斷開與 Internet 的連接并構建您的專案,一旦構建完成并且應用程式啟動,您就可以重新連接。
uj5u.com熱心網友回復:
問題來自于 jcenter 的關閉。如果您洗掉應用程式的存盤庫,如果您的一些宣告,您將收到錯誤jcenter()。
最好的方法是合并 PR 并更新這些依賴項的版本,但這可能需要一段時間。
同時,您可以在 中添加以下內容android/app/build.gradle:
allprojects {
repositories {
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
if (repo.url.toString().startsWith('https://jcenter.bintray.com/')) {
remove repo
add(mavenCentral())
}
}
}
...
這修復了我所有的構建。
uj5u.com熱心網友回復:
@PhilippeAuriach 的解決方案是為 react-native 修復它!我添加了這個:
allprojects {
repositories {
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
if (repo.url.toString().startsWith('https://jcenter.bintray.com/')) {
remove repo
add(mavenCentral())
}
}
}
到我的android/build.gradle并經過數小時的研究作業正常!(感謝@PhilippeAuriach)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/523938.html
標籤:安卓反应式安卓工作室中心
上一篇:Android:錯誤:mergeDebugResources。|無法決議androidx.room:room-common:[2.3.0]。|讀取超時
