Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD FAILED #3114

Closed
8 tasks done
huangsir0 opened this issue Jul 30, 2024 · 3 comments
Closed
8 tasks done

BUILD FAILED #3114

huangsir0 opened this issue Jul 30, 2024 · 3 comments
Labels
compile Compilation error triage

Comments

@huangsir0
Copy link

Operating System

windows 10

Plugin

sensors_plus

Version

4.0.2

Flutter SDK

3.22.1

Compilation command

flutter build apk --release --obfuscate --split-debug-info=debug-info

Dart Dependencies

No response

Native dependencies

No response

Compilation Error

ERROR:E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\479dafef2b39c831174bab6a1166ec2329da047196ad8e7f36317e3828888435_0.jar: D8: Type dev.fluttercommunity.plus.sensors.BuildConfig is defined multiple times: E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\479dafef2b39c831174bab6a1166ec2329da047196ad8e7f36317e3828888435_0.jar:classes.dex, E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\874ac564cfd17125130039fcd09fdd806f0a138b2533b9f13e5437922dfbd590_0.jar: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 dev.fluttercommunity.plus.sensors.BuildConfig is defined multiple times: E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\479dafef2b39c831174bab6a1166ec2329da047196ad8e7f36317e3828888435_0.jar:classes.dex, E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\874ac564cfd17125130039fcd09fdd806f0a138b2533b9f13e5437922dfbd590_0.jar: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:539)
        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:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\479dafef2b39c831174bab6a1166ec2329da047196ad8e7f36317e3828888435_0.jar:classes.dex
        at Version.fakeStackEntry(Version_3.2.47.java:0)
        at com.android.tools.r8.internal.ci.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:68)
        at com.android.tools.r8.internal.ci.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:28)
        at com.android.tools.r8.internal.ci.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:27)
        at com.android.tools.r8.internal.ci.b(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:3)
        at com.android.tools.r8.D8.run(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:11)
        at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:136)
        ... 38 more
Caused by: com.android.tools.r8.internal.a: Type dev.fluttercommunity.plus.sensors.BuildConfig is defined multiple times: E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\479dafef2b39c831174bab6a1166ec2329da047196ad8e7f36317e3828888435_0.jar:classes.dex, E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\874ac564cfd17125130039fcd09fdd806f0a138b2533b9f13e5437922dfbd590_0.jar:classes.dex
        at com.android.tools.r8.internal.tQ.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:14)
        at com.android.tools.r8.internal.tQ.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:22)
        at com.android.tools.r8.internal.xK.b(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:7)
        at com.android.tools.r8.internal.xK.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:23)
        at com.android.tools.r8.internal.xK.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:10)
        at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056)
        at com.android.tools.r8.internal.xK.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:6)
        at com.android.tools.r8.graph.z2$a.e(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:4)
        at com.android.tools.r8.dex.b.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:105)
        at com.android.tools.r8.dex.b.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:28)
        at com.android.tools.r8.D8.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:26)
        at com.android.tools.r8.D8.d(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:593)
        at com.android.tools.r8.D8.b(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:1)
        at com.android.tools.r8.internal.ci.a(R8_3.2.47_ebadcf1df6fbed6005a238b8399b2cd411e753b60758261060e399f9498872a5:24)
        ... 41 more


FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDexRelease'.
> 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 dev.fluttercommunity.plus.sensors.BuildConfig is defined multiple times: E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\479dafef2b39c831174bab6a1166ec2329da047196ad8e7f36317e3828888435_0.jar:classes.dex, E:\WorkSpace\Flutter\kx_flutter\walang\build\app\intermediates\mixed_scope_dex_archive\release\out\874ac564cfd17125130039fcd09fdd806f0a138b2533b9f13e5437922dfbd590_0.jar:classes.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

BUILD FAILED in 3m 38s

Flutter Doctor

[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [版本 10.0.22621.3880], locale zh-CN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.0)
[√] Android Studio (version 2022.1)
[√] Connected device (4 available)
[!] Network resources
    X A network error occurred while checking "https://maven.google.com/": 信号灯超时时间已到


! Doctor found issues in 1 category.

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@huangsir0 huangsir0 added compile Compilation error triage labels Jul 30, 2024
@aanas-sayed
Copy link
Contributor

Have you tried using the latest version of the plugin? You mentioned you are using version 4.0.2. Current version is 6.0.0.

@huangsir0
Copy link
Author

I solved, this plugin conflict with flutter_contacts: 1.1.9

@andfaraway
Copy link

You can clone flutter_contacts, and change the namespace 'dev.fluttercommunity.plus.sensors' in the android-build.gradle file to 'dev.fluttercommunity.plus.sensors1'. In Flutter, replace flutter_contacts with the local path.
it work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile Compilation error triage
Projects
None yet
Development

No branches or pull requests

4 participants