安装react-native-router-flux后出现错误

问题描述

我创建了一个新的无反应原生项目 在安装react-native-router-flux和react-native install react-native-router-flux并运行react-native run-android之后,我看到了这个错误,项目没有运行。

enter image description here

我的原始错误:

失败:构建失败,并出现异常。

  • 出了什么问题: 无法确定任务':app:mergeDebugAssets'的依赖关系。
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not find androidx.transition:transition:1.1.0.
     Searched in the following locations:
       - file:/C:/Users/Sina/.m2/repository/androidx/transition/transition/1.1.0/transition-1.1.0.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/react-native/android/androidx/transition/transition/1.1.0/transition-1.1.0.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/jsc-android/dist/androidx/transition/transition/1.1.0/transition-1.1.0.pom
       - https://dl.google.com/dl/android/maven2/androidx/transition/transition/1.1.0/transition-1.1.0.pom
       - https://jcenter.bintray.com/androidx/transition/transition/1.1.0/transition-1.1.0.pom
       - https://www.jitpack.io/androidx/transition/transition/1.1.0/transition-1.1.0.pom
     Required by:
         project :app > project :react-native-reanimated
Could not find androidx.fragment:fragment:1.2.1.
     Searched in the following locations:
       - file:/C:/Users/Sina/.m2/repository/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/react-native/android/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/jsc-android/dist/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - https://dl.google.com/dl/android/maven2/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - https://jcenter.bintray.com/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - https://www.jitpack.io/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
     Required by:
         project :app > project :react-native-screens
Could not find androidx.coordinatorlayout:coordinatorlayout:1.1.0.
     Searched in the following locations:
       - file:/C:/Users/Sina/.m2/repository/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/react-native/android/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/jsc-android/dist/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
       - https://dl.google.com/dl/android/maven2/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
       - https://jcenter.bintray.com/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
       - https://www.jitpack.io/androidx/coordinatorlayout/coordinatorlayout/1.1.0/coordinatorlayout-1.1.0.pom
     Required by:
         project :app > project :react-native-screens
Could not find com.google.android.material:material:1.1.0.
     Searched in the following locations:
       - file:/C:/Users/Sina/.m2/repository/com/google/android/material/material/1.1.0/material-1.1.0.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/react-native/android/com/google/android/material/material/1.1.0/material-1.1.0.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/jsc-android/dist/com/google/android/material/material/1.1.0/material-1.1.0.pom
       - https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.1.0/material-1.1.0.pom
       - https://jcenter.bintray.com/com/google/android/material/material/1.1.0/material-1.1.0.pom
       - https://www.jitpack.io/com/google/android/material/material/1.1.0/material-1.1.0.pom
     Required by:
         project :app > project :react-native-screens
Could not find androidx.fragment:fragment:1.2.1.
     Searched in the following locations:
       - file:/C:/Users/Sina/.m2/repository/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/react-native/android/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - file:/C:/Users/Sina/Desktop/HermesLock3/node_modules/jsc-android/dist/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - https://dl.google.com/dl/android/maven2/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - https://jcenter.bintray.com/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
       - https://www.jitpack.io/androidx/fragment/fragment/1.2.1/fragment-1.2.1.pom
     Required by:
         project :app > com.facebook.flipper:flipper:0.37.0 > androidx.appcompat:appcompat:1.1.0
  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行,以获取更多日志输出。使用--scan运行以获取完整的见解。

  • https://help.gradle.org

    获得更多帮助

在3m 43s内失败

错误无法安装该应用程序。确保已设置Android开发环境:https://reactnative.dev/docs/environment-setup。使用--verbose标志运行CLI以获取更多详细信息。 Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

解决方法

如果您来自受到制裁的国家/地区,最好使用代理并重试。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...