Crashlytics NDK multi androidNdkOut path support

北城以北 提交于 2019-12-12 13:00:29

问题


I use Fabric Crashlytic to impove my native code performance. I have multi .so library in both app project and jar library project. In my app's build.gradle,here it is:

crashlytics {
    enableNdk true
    androidNdkOut '<myJarProjectPath>/src/main/obj' //or src/main/obj
    androidNdkLibsOut '<myJarProjectPath>/src/main/jniLibs' //or src/main/jniLibs
}

then I use "crashlyticsUploadSymbolsXXXXRelease" to package my app,and get ndk crash stacktrace in Fabric. But I can only config one of these .so library. I wonder if use "crashlyticsUploadSymbolsXXXXRelease" to get an Apk, what will happen to .so in jar library project? Does anyone know how to support ndk crashlytics both in app project and jar library project?


回答1:


Matt from Crashlytics here!

UPDATE

As of version 1.23.0, the Fabric plugin supports automatic detection of paths for native binaries when using the Android plugin for Gradle 2.2.0+ with the externalNativeBuild DSL. If using this, you should simply remove the androidNdkOut and androidNdkLibsOut properties from your crashlytics block.


Currently we don't have support for defining multiple directories for your native libraries. However, a very simple workaround for this is to define a Gradle task which copies your debug and release .so files from both projects into a common, temporary directory (e.g. temp/ndkout/... and temp/ndklibsout/) and then set your androidNdkOut and androidNdkLibsOut properties to those directories.

One thing to note: you'll need to maintain the architecture-specific folder structure under each set of directories! Here's a full example to give you an idea:

temp/
-- ndkout/
  -- armeabi
    -- libappproject.so
    -- libjarproject.so
  -- x86
    -- libappproject.so
    -- libjarproject.so
  ...
-- ndklibsout/
  -- armeabi
    -- libappproject.so
    -- libjarproject.so
  -- x86
    -- libappproject.so
    -- libjarproject.so
  ...


来源:https://stackoverflow.com/questions/33735332/crashlytics-ndk-multi-androidndkout-path-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!