I'm trying to import a lib *.so
into a module I'm trying to build. Importing directly into apk works perfectly, but when I add in the module, not.
The error returned is:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.stapeapp.demo_stape_sdk, PID: 12855 java.lang.UnsatisfiedLinkError: No implementation found for void com.stapeapp.demo_stape_sdk.teste.native_init() (tried Java_com_stapeapp_demo_1stape_1sdk_teste_native_1init and Java_com_stapeapp_demo_1stape_1sdk_teste_native_1init__) at com.stapeapp.demo_stape_sdk.teste.native_init(Native Method) at com.stapeapp.demo_stape_sdk.teste.<clinit>(teste.java:12) at com.stapeapp.demo_stape_sdk.teste.generateFingerPrint(teste.java) at com.stapeapp.demo_stape_sdk.MainActivity.onCreate(MainActivity.java:60) at android.app.Activity.performCreate(Activity.java:6112) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1117) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721) at android.app.ActivityThread.access$900(ActivityThread.java:168) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5753) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Gradle of apk :
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.stapeapp.demo_stape_sdk"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
sourceSets {
main {
jniLibs.srcDirs = ["src/main/jniLibs"]
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(path: ':stape-sdk')
}
Gradle module :
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
sourceSets {
main {
jniLibs.srcDirs = ["libs"]
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'org.androidannotations:androidannotations-api:3.0.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.kailashdabhi:om-recorder:1.1.5'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation "com.android.support:support-annotations:27.1.1"
}
Where is my error?