exponea / exponea-react-native-sdk

MIT License
8 stars 13 forks source link

Android create archive build is failing with latest version 1.5.0 #86

Closed gdhillon-pbl closed 1 year ago

gdhillon-pbl commented 1 year ago

After upgrading to latest version of exponea-react-native-sdk 1.5.0. It was working just fine with 1.4.0

ERROR:/Users/runner/work/1/s/node_modules/react-native-exponea-sdk/android/build/.transforms/78361bd1a6def157be060e348071c1c8/transformed/release/com/exponea/style/AppInboxListItemStyle.dex: D8: Type com.exponea.style.AppInboxListItemStyle is defined multiple times: /Users/runner/work/1/s/node_modules/react-native-exponea-sdk/android/build/.transforms/78361bd1a6def157be060e348071c1c8/transformed/release/com/exponea/style/AppInboxListItemStyle.dex, /Users/runner/work/1/s/android/app/build/intermediates/external_libs_dex/qaRelease/mergeExtDexQaRelease/classes.dex 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.exponea.style.AppInboxListItemStyle is defined multiple times: /Users/runner/work/1/s/node_modules/react-native-exponea-sdk/android/build/.transforms/78361bd1a6def157be060e348071c1c8/transformed/release/com/exponea/style/AppInboxListItemStyle.dex, /Users/runner/work/1/s/android/app/build/intermediates/external_libs_dex/qaRelease/mergeExtDexQaRelease/classes.dex 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:100) 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:205) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162) at org.gradle.internal.Factories$1.create(Factories.java:31) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249) at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109) at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126) 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 java.base/java.lang.Thread.run(Thread.java:829) Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/runner/work/1/s/node_modules/react-native-exponea-sdk/android/build/.transforms/78361bd1a6def157be060e348071c1c8/transformed/release/com/exponea/style/AppInboxListItemStyle.dex at Version.fakeStackEntry(Version_3.3.83.java:0) at com.android.tools.r8.internal.Hj.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:75) at com.android.tools.r8.internal.Hj.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:28) at com.android.tools.r8.internal.Hj.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:27) at com.android.tools.r8.internal.Hj.b(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:2) at com.android.tools.r8.D8.run(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:11) at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:136) ... 38 more Caused by: com.android.tools.r8.internal.f: Type com.exponea.style.AppInboxListItemStyle is defined multiple times: /Users/runner/work/1/s/node_modules/react-native-exponea-sdk/android/build/.transforms/78361bd1a6def157be060e348071c1c8/transformed/release/com/exponea/style/AppInboxListItemStyle.dex, /Users/runner/work/1/s/android/app/build/intermediates/external_libs_dex/qaRelease/mergeExtDexQaRelease/classes.dex at com.android.tools.r8.internal.LT.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:14) at com.android.tools.r8.internal.LT.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:22) at com.android.tools.r8.internal.JN.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:36) at com.android.tools.r8.internal.JN.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:10) at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048) at com.android.tools.r8.internal.JN.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:6) at com.android.tools.r8.graph.B2$a.e(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:7) at com.android.tools.r8.dex.b.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:101) at com.android.tools.r8.dex.b.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:25) at com.android.tools.r8.dex.b.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:24) at com.android.tools.r8.D8.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:25) at com.android.tools.r8.D8.d(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:606) at com.android.tools.r8.D8.b(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:1) at com.android.tools.r8.internal.Hj.a(R8_3.3.83_3e328a3bbd0c840823c96123eb0f6192f0adf17b30ae46f695be39af0bc3505e:24) ... 41 more

`1: Task failed with an exception.

adam1929 commented 1 year ago

Hi @gdhillon-pbl thank you for your finding. Please try to clean your cache and try to build again. The duplicate class you see (AppInboxListItemStyle) has been moved to latest Android native SDK but this ReactNative has not been adapted to that newest architecture yet. It contains own class implementation. Please try to clean your cache and build again, I'm using these steps: rm -rf $TMPDIR/metro-* watchman watch-del-all npm start -- --reset-cache Or please check if you have native AndroidSDK dependency in gradle that version mismatched with implementation 'com.exponea.sdk:sdk:3.6.1' If problem persists, please re-open this thread. Our tests and app is working but still, we will be working on AppInboxStyle removal for next release.

gdhillon-pbl commented 1 year ago

@adam1929 the issue we are facing in when generating release build archive inside the appcenter, on local it works fine in the debug mode. If we use version 1.4.0 then it works fine when generating the release build archive.

xcibik00 commented 1 year ago

hi @gdhillon-pbl just would like to check if this issue is solved in new 1.5.1 and so it is not occuring on the newest v 1.5.1, please let us know. Thanks!

gdhillon-pbl commented 1 year ago

@xcibik00 it's working with v 1.5.1