Crashlytics NDK多androidNdkOut路径支持 [英] Crashlytics NDK multi androidNdkOut path support

查看:79
本文介绍了Crashlytics NDK多androidNdkOut路径支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Fabric Crashlytic提高本机代码性能.我在应用程序项目和jar库项目中都有多个.so库.在我的应用程序的build.gradle中,它是:

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
}

然后我使用"crashlyticsUploadSymbolsXXXXRelease"打包我的应用程序,并在Fabric中获取ndk崩溃堆栈跟踪.但是我只能配置这些.so库之一.我想知道是否如果使用"crashlyticsUploadSymbolsXXXXRelease"来获得Apk,那么jar库项目中的.so会怎样?有人知道如何在应用程序项目和jar库项目中同时支持ndk crashlytics吗?

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?

推荐答案

来自Crashlytics的问题!

Matt from Crashlytics here!

更新

版本1.23.0 开始,Fabric当将Gradle 2.2.0+的Android插件与externalNativeBuild DSL结合使用时,该插件支持自动检测本机二进制文件的路径.如果使用此选项,则只需从crashlytics块中删除androidNdkOutandroidNdkLibsOut属性.

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.

当前,我们不支持为您的本机库定义多个目录.但是,一个非常简单的解决方法是定义一个Gradle任务,该任务将两个项目中的调试和发布.so文件从两个项目复制到一个公共的临时目录(例如temp/ndkout/ ...和temp/ndklibsout/),然后将您的<这些目录的c1>和androidNdkLibsOut属性.

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
  ...

这篇关于Crashlytics NDK多androidNdkOut路径支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆