我正在尝试构建一个自定义开发客户端,但我在运行gradlew与npx expo run:android
构建失败相同的事情中出现错误,我尝试了很多我在互联网上找到的解决方案,但没有任何工作,所以我希望我能在这里找到答案这是登录终端:
🤖 Android build failed:
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
是完整的错误日志:eas build --profile development --platform android
> Task :app:dexBuilderDebug
> Task :app:mergeDebugJavaResource
> Task :expo-modules-core:prepareBoost
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
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
540 actionable tasks: 540 executed
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeLibDexDebug'.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
[stderr] > There was a failure while executing work items
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction
[stderr] > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
[stderr] Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
[stderr] Type com.bumptech.glide.GeneratedAppGlideModuleImpl is defined multiple times: /home/expo/workingdir/build/node_modules/react-native-fast-image/android/build/.transforms/8485071c78dff0abed4a3b931866670b/transformed/classes/classes.dex, /home/expo/workingdir/build/node_modules/expo-image/android/build/.transforms/e9cf1b24da03614611457bfd0fa1835b/transformed/classes/classes.dex
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] java.lang.StackOverflowError (no error message)
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 5m 57s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
这也是npx expo run:android
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeLibDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
> There was a failure while executing work items
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Type com.bumptech.glide.GeneratedAppGlideModuleImpl is defined multiple times: E:WorkSpaceProjectsReact Nativeelazannode_modulesreact-native-fast-imageandroidbuild.transforms61a2dc3987f9871d3192ff0231abdd0etransformedclassesclasses.dex, E:WorkSpaceProjectsReact Nativeelazannode_modulesexpo-imageandroidbuild.transforms8bd1747da24c2482c4a1d5c764b71a8atransformedclassesclasses.dex
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)
* 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
Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
BUILD FAILED in 27s
498 actionable tasks: 14 executed, 3 from cache, 481 up-to-date
Error: E:WorkSpaceProjectsReact Nativeelazanandroidgradlew.bat exited with non-zero code: 1
Error: E:WorkSpaceProjectsReact Nativeelazanandroidgradlew.bat exited with non-zero code: 1
at ChildProcess.completionListener (E:WorkSpaceProjectsReact Nativeelazannode_modules@expospawn-asyncbuildspawnAsync.js:52:23)
at Object.onceWrapper (node:events:646:26)
at ChildProcess.emit (node:events:526:28)
at ChildProcess.cp.emit (E:WorkSpaceProjectsReact Nativeelazannode_modulescross-spawnlibenoent.js:34:29)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
...
at spawnGradleAsync (E:WorkSpaceProjectsReact Nativeelazannode_modules@expoclibuildsrcstartplatformsandroidgradle.js:72:46)
at Object.assembleAsync (E:WorkSpaceProjectsReact Nativeelazannode_modules@expoclibuildsrcstartplatformsandroidgradle.js:52:18)
at runAndroidAsync (E:WorkSpaceProjectsReact Nativeelazannode_modules@expoclibuildsrcrunandroidrunAndroidAsync.js:31:24)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
- eas版本:eas-cli/3.3.2 win32-x64 node-v16.14.2
如果有人得到同样的错误,我通过卸载expo-image
来解决它