Android Unsatisfied Link using gradle experimental v0.6.0-beta6

后端 未结 1 540
失恋的感觉
失恋的感觉 2021-01-15 16:50

I was trying to create a simple project to test the NDK in which a jnilib uses a prebuilt .so library but I keep getting an UnsatisfiedLink error:

With emulator:

相关标签:
1条回答
  • 2021-01-15 17:27

    This may not be the way these native dependencies were expected to work, but (update: this is implicitly written in the doc!) even with plugin 0.7.0, gradle does not copy libadd.so to the APK. There is a workaround, though; add to build.gradle the enchantment:

    model {
        android.sources.main {
            jniLibs.source.srcDir 'src/main/jni/libs/dynamic'
        }
    }
    

    Still, I recommend to move libs/dynamic folder out of the jni sources folder.

    0 讨论(0)
提交回复
热议问题