无法在模拟器上运行react-native android(Androidx问题)
我退出世博会后遇到了这个问题。我制作了一个新应用程序并正在移动数据。当我安装react-native-screen 和react-native-gesture-handler 时,问题就开始了。这是终端的结果:
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find androidx.cardview:cardview:1.0.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
- https://repo.maven.apache.org/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
- https://dl.google.com/dl/android/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
- https://www.jitpack.io/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
Required by:
project :app > project :react-native-screens > com.google.android.material:material:1.1.0
> Could not find androidx.recyclerview:recyclerview:1.0.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
- https://repo.maven.apache.org/maven2/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
- https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
- https://www.jitpack.io/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
Required by:
project :app > project :react-native-screens > com.google.android.material:material:1.1.0
> Could not find androidx.transition:transition:1.2.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/transition/transition/1.2.0/transition-1.2.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/transition/transition/1.2.0/transition-1.2.0.pom
- https://repo.maven.apache.org/maven2/androidx/transition/transition/1.2.0/transition-1.2.0.pom
- https://dl.google.com/dl/android/maven2/androidx/transition/transition/1.2.0/transition-1.2.0.pom
- https://www.jitpack.io/androidx/transition/transition/1.2.0/transition-1.2.0.pom
Required by:
project :app > project :react-native-screens > com.google.android.material:material:1.1.0
> Could not find androidx.viewpager2:viewpager2:1.0.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
- https://repo.maven.apache.org/maven2/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
- https://dl.google.com/dl/android/maven2/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
- https://www.jitpack.io/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
Required by:
project :app > project :react-native-screens > com.google.android.material:material:1.1.0
> Could not find androidx.annotation:annotation-experimental:1.1.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://repo.maven.apache.org/maven2/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://dl.google.com/dl/android/maven2/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://www.jitpack.io/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
Required by:
project :app > project :react-native-screens > androidx.fragment:fragment:1.3.4
> Could not find androidx.annotation:annotation-experimental:1.1.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://repo.maven.apache.org/maven2/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://dl.google.com/dl/android/maven2/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://www.jitpack.io/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
Required by:
project :app > androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 > androidx.core:core:1.6.0
我尝试下载其中一些文件,但他们不断要求提供更多文件。
I faced this issues after i ejected expo. i made a new app and im moving data. the problem starts when i install react-native-screen and react-native-gesture-handler. here is result of terminal :
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find androidx.cardview:cardview:1.0.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
- https://repo.maven.apache.org/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
- https://dl.google.com/dl/android/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
- https://www.jitpack.io/androidx/cardview/cardview/1.0.0/cardview-1.0.0.pom
Required by:
project :app > project :react-native-screens > com.google.android.material:material:1.1.0
> Could not find androidx.recyclerview:recyclerview:1.0.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
- https://repo.maven.apache.org/maven2/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
- https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
- https://www.jitpack.io/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.pom
Required by:
project :app > project :react-native-screens > com.google.android.material:material:1.1.0
> Could not find androidx.transition:transition:1.2.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/transition/transition/1.2.0/transition-1.2.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/transition/transition/1.2.0/transition-1.2.0.pom
- https://repo.maven.apache.org/maven2/androidx/transition/transition/1.2.0/transition-1.2.0.pom
- https://dl.google.com/dl/android/maven2/androidx/transition/transition/1.2.0/transition-1.2.0.pom
- https://www.jitpack.io/androidx/transition/transition/1.2.0/transition-1.2.0.pom
Required by:
project :app > project :react-native-screens > com.google.android.material:material:1.1.0
> Could not find androidx.viewpager2:viewpager2:1.0.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
- https://repo.maven.apache.org/maven2/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
- https://dl.google.com/dl/android/maven2/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
- https://www.jitpack.io/androidx/viewpager2/viewpager2/1.0.0/viewpager2-1.0.0.pom
Required by:
project :app > project :react-native-screens > com.google.android.material:material:1.1.0
> Could not find androidx.annotation:annotation-experimental:1.1.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://repo.maven.apache.org/maven2/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://dl.google.com/dl/android/maven2/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://www.jitpack.io/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
Required by:
project :app > project :react-native-screens > androidx.fragment:fragment:1.3.4
> Could not find androidx.annotation:annotation-experimental:1.1.0.
Searched in the following locations:
- file:/D:/%projectpath%/node_modules/react-native/android/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- file:/D:/%projectpath%/node_modules/jsc-android/dist/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://repo.maven.apache.org/maven2/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://dl.google.com/dl/android/maven2/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
- https://www.jitpack.io/androidx/annotation/annotation-experimental/1.1.0/annotation-experimental-1.1.0.pom
Required by:
project :app > androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 > androidx.core:core:1.6.0
i tried downloading some of them but they keep ask for more files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案1:删除gradle中所有缓存的文件夹并构建新项目。
解决方案2:android/build.gradle
解决方案3:如果不想升级到sdk 31,请在android/app/build.gradle中添加
solution 1: deleted all the cached folders in gradle and build new project.
solution 2: android/build.gradle
solution 3: If you don't want to upgrade to sdk 31, add in android/app/build.gradle