Android Studio 2.0 Preview 5, linking ndk app fails to locate module .so and .a -
i have ndk project 2 modules:
- abwrenderer - native library module
- app - native , java hybrid, glues java abwrenderer
i updated 2.0 preview 5 morning, , encountered gradle related issues.
i upgraded gradle-2.10 , switched gradle-experimental:0.6.0-alpha5. when attempting debug, ndk build triggered , run following problem:
error:error: c:\android\projects\foo\abwrenderer\build\intermediates\binaries\debug\obj\armeabi-v7a\libabwrenderer.so: no such file or directory
now when on gradle-2.9 & gradle-experimental:0.6.0-alpha3, libraries built in directory. after morning's upgrades, libraries located in: c:\android\projects\foo\abwrenderer\build\libs\abwrenderer\shared\armeabi-v7a\debug
is there way update search location project dependencies build libraries?
for reference, define dependency on abwrenderer project follows (build.gradle (app)):
android.sources { main { jni { source { srcdirs 'src/main/jni' } dependencies { project ":abwrenderer" buildtype "debug" linkage "shared" } } jnilibs { source { srcdirs 'src/main/libs' } } } }
and build.gradle abwrenderer project follows:
apply plugin: "com.android.model.native" model { android { compilesdkversion = 23 } android.ndk { modulename = "abwrenderer" cppflags.addall(["--std=c++11", "-fexceptions", "-frtti"]) ldlibs.addall(["android", "egl", "glesv3", "log", "dl"]) stl = "c++_static" debuggable = true } android.sources { main { jni { exportedheaders { srcdir "src/main/jni" } } } } }
i have invalidated caches , restarted, done clean build, etc. appreciated!
your defaultconfig , ndk blocks missing info. should similar this:
defaultconfig { applicationid = 'com.myapp.abwrenderer' minsdkversion.apilevel = 13 targetsdkversion.apilevel = 23 versioncode = 1 versionname = '1.0' } ndk { platformversion = 21 modulename = 'abwrenderer' toolchain = 'clang' stl = 'gnustl_static' cppflags.addall(['-std=c++11']) ldlibs.addall(['android', 'egl', 'glesv3', 'log', 'dl']) }
you should take @ following ndk sample google see how did it: hello-libs
Comments
Post a Comment