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

Package broken on Android with Flutter version 3.16.0 #264

Open
JoseGeorges8 opened this issue Nov 16, 2023 · 4 comments
Open

Package broken on Android with Flutter version 3.16.0 #264

JoseGeorges8 opened this issue Nov 16, 2023 · 4 comments

Comments

@JoseGeorges8
Copy link

JoseGeorges8 commented Nov 16, 2023

Steps to reproduce

  1. run flutter upgrade and make sure you are on 3.16.0
  2. Create new flutter project
  3. Add package as a dependency
  4. Run the app

Breaks with the following exception:

* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
      - /Users/username/.gradle/caches/transforms-3/c9edf73c2f7e2730d5aebc17d49b6083/transformed/jetified-arm64_v8a_debug-1.0.0-74d16627b940bb15e50891f82cad6c3e3465bd6d/arm64-v8a/libc++_shared.so
      - /Users/username/.gradle/caches/transforms-3/815e85428dc3d5b8fae31f7b2e7a8e16/transformed/jetified-pdfium-android-1.9.2/jni/arm64-v8a/libc++_shared.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

UPDATE
Seems like this only happens when trying to build in debug mode.

@DanilKarasev
Copy link

Same issue here, works in profile mode

@gmm81
Copy link

gmm81 commented Nov 21, 2023

Add following into your build.gradle as a hotfix (FYI build on linux or windows goes well)
packagingOptions { pickFirst 'lib/x86/libc++_shared.so' pickFirst 'lib/x86_64/libc++_shared.so' pickFirst 'lib/armeabi-v7a/libc++_shared.so' pickFirst 'lib/arm64-v8a/libc++_shared.so'}

@adamszalma
Copy link

Seems like this is related to flutter/flutter#138535

@Laferu
Copy link

Laferu commented Mar 5, 2024

I also have the same problem in Flutter version 3.16.9. For now I'm using packagingOptions to work around the problem, but it doesn't seem to be the right way.

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

No branches or pull requests

5 participants