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

Conflict with c++_shared #47

Open
renetik opened this issue Dec 27, 2022 · 2 comments
Open

Conflict with c++_shared #47

renetik opened this issue Dec 27, 2022 · 2 comments

Comments

@renetik
Copy link

renetik commented Dec 27, 2022

I believe library shall not add its own c++_shared lib.
When we have build arguments:

android {
    compileSdkVersion project.properties.sdk_version
    defaultConfig {
        minSdkVersion project.properties.min_sdk_version
        targetSdkVersion project.properties.sdk_version
        externalNativeBuild {
            cmake {
                cppFlags "-std=c++14 -fexceptions"
                arguments "-DANDROID_ARM_NEON=TRUE",'-DANDROID_STL=c++_shared'
            }
        }
    }

Build fails with:

2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:

  • /Users/renetik/Development/renetik-instruments-android/project/renetik-instruments-library-audio/build/intermediates/library_jni/debug/jni/arm64-v8a/libc++_shared.so
  • /Users/renetik/.gradle/caches/transforms-3/49930d1a19493a31fa0ff855b95c71e4/transformed/jetified-mobile-ffmpeg-full-4.4/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
@alibabayev0
Copy link

Please may you try with that:

android {
    ...
    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'
    }
    ...
}

@renetik
Copy link
Author

renetik commented Dec 27, 2022

Well I dont like this solution you propose as it will clutter build gradle.
Isnt it better to just ommit and use that cmake solution ? Or you cannot for other reason ? For now I am good as it is I just commented it out, everything seems ok, depended code use libc++_shared from your lib obviously.

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

2 participants