BelledonneCommunications / linphone-android

Linphone.org mirror for linphone-android (https://gitlab.linphone.org/BC/public/linphone-android)
https://linphone.org
GNU General Public License v3.0
1.12k stars 685 forks source link

Couldn't find "libc++_shared.so" error when using maven repository #784

Closed alishir closed 5 years ago

alishir commented 5 years ago

I created a new android project and added linphone maven repository to the app module build.gradle. I also added implementation "org.linphone:linphone-sdk-android:4.2+" to the module dependencies. When I tried to run the project on android I got couldn't find "libc++_shared.so" error.

It seems the downloaded archive doesn't contain libc++_shared.so. I also checked the files in grable cache and there is no libc++_shared.so. How should I fix this issue?

Viish commented 5 years ago

Hi,

Thanks for reporting this issue.

Could you tell me which version of the AAR you have ? In Android studio, switch from Android to Project view and under External Libraries it will list all the AARs and their version.

Thanks in advance.

Viish commented 5 years ago

For info, I just checked the latest one (4.2-166-ge2e87a3) and it is fine.

alishir commented 5 years ago

Hi @Viish, Thanks for your reply, I'm using snapshot maven repository and the version of library is: 4.2-166-ge2e87a3. I also tested sample project from linphone-android, it works fine. But I couldn't figure out why my project doesn't work and why library loader couldn't find libc++_shared.so.

Here is my build.gradle:

repositories {
    maven {
        // Replace snapshots by releases for releases !
        url "https://linphone.org/snapshots/maven_repository"
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation "org.jetbrains.anko:anko-commons:$anko_version"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.linphone:linphone-sdk-android:4.2+"
   .....
   .....
}

And here is the code that cause the exception:

    val basePath = filesDir.absolutePath
>>  Factory.instance().setLogCollectionPath(basePath)
    Factory.instance().enableLogCollection(LogCollectionState.Enabled)
    Factory.instance().setDebugMode(true, TAG)
alishir commented 5 years ago

Hi @Viish I just created a new android project and copy the snippets to the new project and all things is fine. I think my previous project structure have some problems.

Thanks for your caring.