当我试图通过使用生成android apk时./gradlew installRelease
,我在控制台中收到此错误:
~/React-Native/mockingbird/android/app/build/intermediates/res/merged/release/drawable-mdpi-v4/src_resources_img_loading.gif: error: Duplicate file.
~/React-Native/mockingbird/android/app/build/intermediates/res/merged/release/drawable-mdpi/src_resources_img_loading.gif: Original is here. The version qualifier may be implied.
Run Code Online (Sandbox Code Playgroud)
我尝试Build->Clean Project
通过Android Studio ./gradlew installRelease
再次运行; 它也没用.
此外,我尝试删除该build
文件夹,但它也没有帮助.
在升级到React Native 0.57之后,当我在执行.\ gradlew汇编时发生APK在react-native-router-flux中时,我遇到了一个问题.我得到以下错误: -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> [drawable-mdpi-v4/node_modules_reactnativerouterflux_images_back_chevron]
R:\Workings\lisecapps\androidrepo\test-react-
native\venutest\android\app\src\main\res\drawable-
mdpi\node_modules_reactnativerouterflux_images_back_chevron.png
[drawable-mdpi-v4/node_modules_reactnativerouterflux_images_back_chevron]
R:\Workings\lisecapps\androidrepo\test-react-
emirnative\venutest\android\app\build\generated\res\react\release\drawable-
mdpi-v4\node_modules_reactnativerouterflux_images_back_chevron.png: Error:
Duplicate resources
[drawable-mdpi-v4/node_modules_reactnativerouterflux_images_menu_burger]
R:\Workings\lisecapps\androidrepo\test-react-nat
ive\venutest\android\app\src\main\res\drawable-
mdpi\node_modules_reactnativerouterflux_images_menu_burger.png
[drawable-mdpi-v4/node_modules_reactnativerouterflux_images_menu_burger]
R:\Workings\lisecapps\androidrepo\test-react-
native\venutest\android\app\build\generated\res\react\release\drawable-mdpi-
v4\node_modules_reactnativerouterflux_images_menu_burger.png: Error:
Duplicate resources
Run Code Online (Sandbox Code Playgroud)
我尝试了以下解决但仍然相同的错误: -
安装一些类似react-native-safe-area-context
或 的软件包后react-native-screen
,我总是遇到这个问题:无法运行该应用程序
当我运行yarn android时:
> Configure project :react-native-async-storage_async-storage
Subproject ':react-native-async-storage_async-storage' has location 'D:\ewm\git\itc\node_modules\@react-native-async-storage\async-storage\android' which is outside of the project root. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0.
> Configure project :react-native-safe-area-context
Subproject ':react-native-safe-area-context' has location 'D:\ewm\git\itc\node_modules\react-native-safe-area-context\android' which is outside of the project root. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0.
> Task :react-native-safe-area-context:compileDebugKotlin
w: D:\ewm\git\itc\node_modules\react-native-safe-area-context\android\src\main\java\com\th3rdwave\safeareacontext\SafeAreaView.kt: (50, 23): 'getter for uiImplementation: UIImplementation!' is …
Run Code Online (Sandbox Code Playgroud) 当我在移动设备中运行应用程序时,我正在使用expo 43
withAmplify
expo run:android
Run Code Online (Sandbox Code Playgroud)
我可以看到我的应用程序在移动设备上运行。
但是当我尝试创建相同的构建时
eas build -p android
Run Code Online (Sandbox Code Playgroud)
我遇到以下错误
Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase
Run Code Online (Sandbox Code Playgroud)
这是 eas json
{
"cli": {
"version": ">= 0.46.0"
},
"build": {
"development": {
"distribution": "internal",
"android": {
"gradleCommand": ":app:assembleDebug"
},
"ios": {
"buildConfiguration": "Debug"
}
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}
Run Code Online (Sandbox Code Playgroud)
这是 eas build 的日志
[stderr] 40 | import { enableScreens } …
Run Code Online (Sandbox Code Playgroud)