I'm developing a flutter plugin for linphone and there was a problem that linphone has conflicts with vlc player.
Describe the bug
When I connect my plugin (using org.linphone:linphone-sdk-android:5.2.110) and vlc player (https://github.com/solid-software/flutter_vlc_player), I got this error:
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/gubin-dev/.gradle/caches/transforms-3/47f6bfde09cbc2ffc4d6be1c77074725/transformed/jetified-libvlc-all-3.6.0-eap9/jni/arm64-v8a/libc++_shared.so
- /Users/gubin-dev/.gradle/caches/transforms-3/20be0c7a91255eff9bf01ddd563eb124/transformed/jetified-linphone-sdk-android-5.2.110/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
To Reproduce
add to app/build.gradle
dependencies {
implementation 'org.linphone:linphone-sdk-android:5.2.110'
implementation 'org.videolan.android:libvlc-all:3.6.0-eap9'
}
Expected behavior (mandatory)
Two libraries are up and running
Please complete the following information (mandatory)
Device: google pixel 7
OS: desktop - OS 13.6.1 (22G313), phone - Android 14
Version of the SDK: 5.2.110
Where you did got it from: local build
I tried adding this to app/build.gradle:
packagingOptions {
pickFirst 'lib/**/libc++_shared.so'
}
After that the application built, but I got another error already after launching it:
Syncing files to device Pixel 7...
D/CompatibilityChangeReporter(19083): Compat change id reported: 183155436; UID 10341; state: ENABLED
I/FirebaseApp(19083): Device unlocked: initializing all Firebase APIs for app [DEFAULT]
W/FlutterJNI(19083): FlutterJNI.loadLibrary called more than once
I/ResourceExtractor(19083): Found extracted resources res_timestamp-42-1702570798560
W/FlutterJNI(19083): FlutterJNI.prefetchDefaultFontManager called more than once
W/FlutterJNI(19083): FlutterJNI.init called more than once
I/FLTFireBGExecutor(19083): Creating background FlutterEngine instance, with args: [--start-paused, --enable-dart-profiling]
I/<app.domain>(19083): Rejecting re-init on previously-failed class java.lang.Class<org.linphone.core.FactoryImpl>: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~feRTIduefB1drWAAQTpa3w==/com.rsti.domservice-8P2HxL-HF0j0y-dUYbZf-w==/base.apk!/lib/arm64-v8a/libmediastreamer.so"...
I/<app.domain>(19083): (Throwable with no stack trace)
E/GeneratedPluginsRegister(19083): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@6dda15f) but could not find or invoke the GeneratedPluginRegistrant.
E/GeneratedPluginsRegister(19083): Received exception while registering
E/GeneratedPluginsRegister(19083): java.lang.reflect.InvocationTargetException
E/GeneratedPluginsRegister(19083): at java.lang.reflect.Method.invoke(Native Method)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins(GeneratedPluginRegister.java:80)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:381)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:284)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:265)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:245)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:165)
E/GeneratedPluginsRegister(19083): at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0$io-flutter-plugins-firebase-messaging-FlutterFirebaseMessagingBackgroundExecutor(FlutterFirebaseMessagingBackgroundExecutor.java:167)
E/GeneratedPluginsRegister(19083): at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor$$ExternalSyntheticLambda0.run(Unknown Source:8)
E/GeneratedPluginsRegister(19083): at android.os.Handler.handleCallback(Handler.java:958)
E/GeneratedPluginsRegister(19083): at android.os.Handler.dispatchMessage(Handler.java:99)
E/GeneratedPluginsRegister(19083): at android.os.Looper.loopOnce(Looper.java:205)
E/GeneratedPluginsRegister(19083): at android.os.Looper.loop(Looper.java:294)
E/GeneratedPluginsRegister(19083): at android.app.ActivityThread.main(ActivityThread.java:8177)
E/GeneratedPluginsRegister(19083): at java.lang.reflect.Method.invoke(Native Method)
E/GeneratedPluginsRegister(19083): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/GeneratedPluginsRegister(19083): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
E/GeneratedPluginsRegister(19083): Caused by: java.lang.NoClassDefFoundError: org.linphone.core.FactoryImpl
E/GeneratedPluginsRegister(19083): at org.linphone.core.Factory.instance(Factory.java:49)
E/GeneratedPluginsRegister(19083): at <plugin.domain>.sip_linphone.SipLinphoneCore.<init>(SipLinphoneCore.kt:29)
E/GeneratedPluginsRegister(19083): at <plugin.domain>.sip_linphone.SipLinphonePlugin.onAttachedToEngine(SipLinphonePlugin.kt:22)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.add(FlutterEngineConnectionRegistry.java:146)
E/GeneratedPluginsRegister(19083): at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:119)
E/GeneratedPluginsRegister(19083): ... 17 more
E/GeneratedPluginsRegister(19083): Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~feRTIduefB1drWAAQTpa3w==/com.<app.domain>-8P2HxL-HF0j0y-dUYbZf-w==/base.apk!/lib/arm64-v8a/libmediastreamer.so"...
E/GeneratedPluginsRegister(19083): at java.lang.Runtime.loadLibrary0(Runtime.java:1082)
E/GeneratedPluginsRegister(19083): at java.lang.Runtime.loadLibrary0(Runtime.java:1003)
E/GeneratedPluginsRegister(19083): at java.lang.System.loadLibrary(System.java:1661)
E/GeneratedPluginsRegister(19083): at org.linphone.core.FactoryImpl.<clinit>(Factory.java:753)
E/GeneratedPluginsRegister(19083): at org.linphone.core.Factory.instance(Factory.java:49)
E/GeneratedPluginsRegister(19083): at <plugin.domain>.sip_linphone.SipLinphoneCore.<init>(SipLinphoneCore.kt:29)
E/GeneratedPluginsRegister(19083): at <plugin.domain>.sip_linphone.SipLinphonePlugin.onAttachedToEngine(SipLinphonePlugin.kt:22)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.add(FlutterEngineConnectionRegistry.java:146)
E/GeneratedPluginsRegister(19083): at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:119)
E/GeneratedPluginsRegister(19083): at java.lang.reflect.Method.invoke(Native Method)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins(GeneratedPluginRegister.java:80)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.android.FlutterFragmentActivity.configureFlutterEngine(FlutterFragmentActivity.java:781)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.android.FlutterFragment.configureFlutterEngine(FlutterFragment.java:1543)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:214)
E/GeneratedPluginsRegister(19083): at io.flutter.embedding.android.FlutterFragment.onAttach(FlutterFragment.java:1062)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.Fragment.performAttach(Fragment.java:3068)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentStateManager.attach(FragmentStateManager.java:490)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:265)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1839)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3042)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2952)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
E/GeneratedPluginsRegister(19083): at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
E/GeneratedPluginsRegister(19083): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1582)
E/GeneratedPluginsRegister(19083): at android.app.Activity.performStart(Activity.java:8628)
E/GeneratedPluginsRegister(19083): at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3807)
E/GeneratedPluginsRegister(19083): at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:225)
E/GeneratedPluginsRegister(19083): at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:205)
E/GeneratedPluginsRegister(19083): at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:177)
E/GeneratedPluginsRegister(19083): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
E/GeneratedPluginsRegister(19083): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
E/GeneratedPluginsRegister(19083): at android.os.Handler.dispatchMessage(Handler.java:106)
E/GeneratedPluginsRegister(19083): ... 6 more