简体   繁体   English

Android Crashlytics ndk; build.gradle中NdkOut和NdkLibsOut的值

[英]Android Crashlytics ndk; values of NdkOut and NdkLibsOut in build.gradle

I have integrated Crashlytics, Fabric into my app, the sdk related crashes are reported successfully. 我已将Crashlytics, Fabric集成到我的应用程序中,成功报告了与sdk相关的崩溃。

For the ndk part, i have followed instructions from the blog; 对于ndk部分,我已按照博客的说明进行操作; The Wait is Over: Launching Crashlytics for Android NDK , but the ndk crashes aren't being reported. 等待结束:为Android NDK启动Crashlytics ,但没有报告ndk崩溃。 My doubt is, because other parts are sufficiently clear, i'm not providing the correct path for androidNdkOut and androidNdkLibsOut , as shown in: 我的疑问是,因为其他部分足够清楚,我没有为androidNdkOutandroidNdkLibsOut提供正确的路径,如下所示:

在此输入图像描述

The doubt and question is in my build.gradle , here it is... 怀疑和问题在我的build.gradle ,在这里......

crashlytics {  

    enableNdk true
    androidNdkOut //what would be the obj here?
    androidNdkLibsOut 'src/main/jniLibs' //path for my jni libraries  

}

please let me know if i should post any other part of the code 如果我要发布代码的任何其他部分,请告诉我

EDIT/UPDATE July 7, 2017 编辑/更新2017年7月7日

Matt from the Fabric team here with an update to this answer - we just released the Fabric Gradle plugin version 1.23.0 which includes support for automatically detecting the appropriate native library paths when you're using the externalNativeBuild DSL with the Android plugin for Gradle version 2.2.0+, so you no longer need to set the androidNdkOut and androidNdkLibsOut properties. 来自Fabric团队的Matt对此答案进行了更新 - 我们刚刚发布了Fabric Gradle插件版本1.23.0,其中包括支持在使用带有Gradle版本的Android插件的externalNativeBuild DSL时自动检测相应的本机库路径2.2.0+,所以你不再需要设置androidNdkOutandroidNdkLibsOut属性。 This will work with both CMake and ndk-build . 这适用于CMake和ndk-build Check out more info here: https://docs.fabric.io/android/crashlytics/ndk.html#specifying-the-path-to-debug-and-release-binaries 在这里查看更多信息: https//docs.fabric.io/android/crashlytics/ndk.html#specifying-the-path-to-debug-and-release-binaries


I could solve the problem after getting help from Crashlytics/Fabric Support, thanking them..this answer. 我可以在获得Crashlytics / Fabric Support的帮助后解决问题,感谢他们......这个答案。

First, for 首先,为

crashlytics {  

    enableNdk true
    androidNdkOut //what would be the obj here?
    androidNdkLibsOut 'src/main/jniLibs' //path for my jni libraries  

}  

for my app's build.gradle , it should have been: 对于我的应用程序的build.gradle ,应该是:

crashlytics {
    enableNdk true
    androidNdkOut 'src/main/jniLibs'
    androidNdkLibsOut 'src/main/jniLibs'
}  

androidNdkOut is where your debug binaries are located. androidNdkOut是调试二进制文件所在的位置。 This defaults to 'src/main/obj' but you can set in the crashlytics { } if it's different in your project. 默认为'src / main / obj',但如果项目中的不同,您可以在crashlytics {}中设置。

a link which contains useful information on the same: crashlytics knowledgebase; 一个包含相同信息的链接: crashlytics知识库; Missing line numbers in native crashes 原生崩溃中缺少行号

A minor but very useful part was running commands like uploadReleaseSymbols with the --stacktrace option. 一个次要但非常有用的部分是使用--stacktrace选项运行uploadReleaseSymbols--stacktrace命令。 Thought its worth the mention as that(uploading release symbols) was also an issue on my side for not receiving the crash reports. 认为值得一提的是(上传发布符号)也是我没有收到崩溃报告的问题。

Follow this guide - https://fabric.io/downloads/gradle/ndk . 请遵循本指南 - https://fabric.io/downloads/gradle/ndk We kept empty both fields (androidNdkOut and NdkLibsOut) 我们保持两个字段为空(androidNdkOut和NdkLibsOut)

Had a similar problem: I had to add CrashlyticsNdk kit at Fabric.with(). 有类似的问题:我必须在Fabric.with()中添加CrashlyticsNdk工具包。

Fabric fabric = new Fabric.Builder(context)
    .kits(new Twitter(authConfig), new Crashlytics(), new CrashlyticsNdk())
    .debuggable(true)
    .build();
Fabric.with(fabric);

you can check androidNdkOut , androidNdkLibsOut this way. 你可以androidNdkLibsOut这种方式检查androidNdkOutandroidNdkLibsOut

$ ./gradlew -d clean assemble{Flavor} | grep ndk-build

and you will find NDK_OUT and NDK_LIBS_OUT . 你会发现NDK_OUTNDK_LIBS_OUT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM