Search code examples
androidandroid-ndkpjsipandroid-studio-3.0

Android Studio 3: useDeprecatedNdk no longer supported


I am developing an app using PJSIP. I have .so libraries (compiled using ndk-r10e) that they were working well before upgrade to Android Studio 3.0. This upgrade no longer supports useDeprecatedNdk and console says to follow this tutorial: Migrate from ndkCompile

I made this tutorial done and build is OK but running an app returns error:

Error:Execution failed for task ':pjsua:transformNativeLibsWithMergeJniLibsForDebug'.
> More than one file was found with OS independent path 'lib/armeabi-v7a/libpjsua2.so'

I have already tried clean and Invalidate cache / restart.

Can anybody help?


Solution

  • I put this into gradle and it seems it's working now...

    android {
        packagingOptions {
            pickFirst 'lib/armeabi-v7a/libpjsua2.so'
            pickFirst 'lib/armeabi/libpjsua2.so'
            pickFirst 'lib/x86/libpjsua2.so'
        }
    }