답변 1
0
뭘 시도해보셨는지도 알려주시면 좋습니다. 괜히 잘못된 거 시도하면 할수록 더 꼬입니다. 에러메시지도 잘려서 정확히 잘 모르겠네요.
일단 android 폴더에서 ./gradlew clean 후 재실행해보시고
그래도 안 되면
https://github.com/react-native-webview/react-native-webview/issues/1344#issuecomment-650544648
이거 한 번 해보세요.
아 원인찾았습니다.
@react-native-community/async-storage 설치하신 것 같은데
@react-native-async-storage/async-storage 설치하셔야 합니다.
네네 ㅠ 그 node lock하고 기존 node_module 싹날리고 다시 npm i 했는데도 어디 남아있나봐요 ㅠ 같은 에러가 뜨는것같네요 ㅠ 혹시 gradle? 쪽 삭제해야하는 부분이 있을까요?
@react-native-community/async-storage 제거하신 것 맞나요?
npm rm @react-native-community/async-storage
오 되었씁니다 ㅠㅠ 감사해요!!!!!
package에서 제거하고 다시 설치하면 완전 제거되는게 아닌가보네요... uninstall 실행하고 다시 npm i 했습니다!
우아 제로초님! 빠른 답변 감사드립니다
우선 태그해주신 multiDex;; true 는 해보았구요
전체 에러로그 붙일게요 ㅠㅠ
> Executing task: npm run android <
> copyDeli@0.0.1 android C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli
> react-native run-android
warn Package react-native-flipper has been ignored because it contains invalid configuration. Reason: "dependency.platforms.ios.project" is not allowed
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1125 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Configure project :app
Reading env from: .env
> Task :app:mergeLibDexDebug FAILED
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.3.3/userguide/command_line_interface.html#sec:command_line_warnings
135 actionable tasks: 2 executed, 133 up-to-date
ERROR:C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex: D8: Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex, C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\rn-async-storage-flipper\android\build\.transforms\f0de2b75a36939c84cfae600ffaf7ef8\transformed\classes\classes.dex
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex, C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\rn-async-storage-flipper\android\build\.transforms\f0de2b75a36939c84cfae600ffaf7ef8\transformed\classes\classes.dex
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:151)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:138)
at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:859)
at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:805)
at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:97)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:206)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:214)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex
at Version.fakeStackEntry(Version_3.1.51.java:0)
at com.android.tools.r8.internal.oO0.a(SourceFile:68)
at com.android.tools.r8.internal.oO0.a(SourceFile:28)
at com.android.tools.r8.internal.oO0.a(SourceFile:27)
at com.android.tools.r8.internal.oO0.b(SourceFile:3)
at com.android.tools.r8.D8.run(D8.java:11)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:136)
... 33 more
Caused by: com.android.tools.r8.internal.b: Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex, C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\rn-async-storage-flipper\android\build\.transforms\f0de2b75a36939c84cfae600ffaf7ef8\transformed\classes\classes.dex
at com.android.tools.r8.internal.il1.a(SourceFile:14)
at com.android.tools.r8.internal.il1.a(SourceFile:22)
at com.android.tools.r8.internal.lf1.b(SourceFile:6)
at com.android.tools.r8.internal.lf1.a(SourceFile:23)
at com.android.tools.r8.internal.lf1.a(SourceFile:10)
at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
at com.android.tools.r8.internal.lf1.a(SourceFile:6)
at com.android.tools.r8.graph.r2$a.f(SourceFile:4)
at com.android.tools.r8.dex.b.a(SourceFile:96)
at com.android.tools.r8.dex.b.a(SourceFile:21)
at com.android.tools.r8.D8.a(D8.java:21)
at com.android.tools.r8.D8.d(D8.java:11)
at com.android.tools.r8.D8.b(D8.java:1)
at com.android.tools.r8.internal.oO0.a(SourceFile:24)
... 36 more
FAILURE: Build 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:
Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex, C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\rn-async-storage-flipper\android\build\.transforms\f0de2b75a36939c84cfae600ffaf7ef8\transformed\classes\classes.dex
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
* 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
BUILD FAILED in 9s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
ERROR:C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex: D8: Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex, C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\rn-async-storage-flipper\android\build\.transforms\f0de2b75a36939c84cfae600ffaf7ef8\transformed\classes\classes.dex
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex, C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\rn-async-storage-flipper\android\build\.transforms\f0de2b75a36939c84cfae600ffaf7ef8\transformed\classes\classes.dex
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:151)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:138)
at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:859)
at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:805)
at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:97)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:206)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:214)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex
at Version.fakeStackEntry(Version_3.1.51.java:0)
at com.android.tools.r8.internal.oO0.a(SourceFile:68)
at com.android.tools.r8.internal.oO0.a(SourceFile:28)
at com.android.tools.r8.internal.oO0.a(SourceFile:27)
at com.android.tools.r8.internal.oO0.b(SourceFile:3)
at com.android.tools.r8.D8.run(D8.java:11)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:136)
... 33 more
Caused by: com.android.tools.r8.internal.b: Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex, C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\rn-async-storage-flipper\android\build\.transforms\f0de2b75a36939c84cfae600ffaf7ef8\transformed\classes\classes.dex
at com.android.tools.r8.internal.il1.a(SourceFile:14)
at com.android.tools.r8.internal.il1.a(SourceFile:22)
at com.android.tools.r8.internal.lf1.b(SourceFile:6)
at com.android.tools.r8.internal.lf1.a(SourceFile:23)
at com.android.tools.r8.internal.lf1.a(SourceFile:10)
at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
at com.android.tools.r8.internal.lf1.a(SourceFile:6)
at com.android.tools.r8.graph.r2$a.f(SourceFile:4)
at com.android.tools.r8.dex.b.a(SourceFile:96)
at com.android.tools.r8.dex.b.a(SourceFile:21)
at com.android.tools.r8.D8.a(D8.java:21)
at com.android.tools.r8.D8.d(D8.java:11)
at com.android.tools.r8.D8.b(D8.java:1)
at com.android.tools.r8.internal.oO0.a(SourceFile:24)
... 36 more
FAILURE: Build 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:
Type com.reactnativecommunity.asyncstorage.AsyncLocalStorageUtil is defined multiple times: C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\async-storage\android\build\.transforms\ca8c5e4d39e9dc44401e73dec9930636\transformed\classes\classes.dex, C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\rn-async-storage-flipper\android\build\.transforms\f0de2b75a36939c84cfae600ffaf7ef8\transformed\classes\classes.dex
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
* 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
BUILD FAILED in 9s
at makeError (C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOnAllDevices (C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\musem\Documents\react-native\copyFoodDeli\copyDeli\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! copyDeli@0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the copyDeli@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\musem\AppData\Roaming\npm-cache\_logs\2022-07-04T06_52_16_432Z-debug.log
터미널 프로세스 "C:\WINDOWS\System32\cmd.exe /d /c npm run android"이(가) 종료되었습니다(종료 코드: 1).
터미널이 작업에서 다시 사용됩니다. 닫으려면 아무 키나 누르세요.