android - 应用程序因 native 代码而崩溃

标签 android android-ndk java-native-interface crashlytics .so

Crashed: .onlineradioapp|
0  gralloc.rk30board.so           0xb4a2d616 bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
1  gralloc.rk30board.so           0xb4a315c9 (Missing)
2  gralloc.rk30board.so           0xb48e2465 art::JValue art::interpreter::ExecuteGotoImpl<true, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
3  gralloc.rk30board.so           0xb4a1349d artInterpreterToInterpreterBridge
4  gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
5  gralloc.rk30board.so           0xb48f2fef art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
6  gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
7  gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
8  gralloc.rk30board.so           0xb48f2c1b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
9  gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
10 gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
11 gralloc.rk30board.so           0xb4a30de9 (Missing)
12 gralloc.rk30board.so           0xb48f308b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
13 gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
14 gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
15 gralloc.rk30board.so           0xb48f2c1b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
16 gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
17 gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
18 gralloc.rk30board.so           0xb48f2c1b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
19 gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
20 gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
21 gralloc.rk30board.so           0xb48f2c1b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
22 gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
23 gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
24 gralloc.rk30board.so           0xb48f2c1b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
25 gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
26 gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
27 gralloc.rk30board.so           0xb48f2c1b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
28 gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
29 gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
30 gralloc.rk30board.so           0xb48f2c1b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
31 gralloc.rk30board.so           0xb4a133dd artInterpreterToInterpreterBridge
32 gralloc.rk30board.so           0xb4a2d031 bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)
33 gralloc.rk30board.so           0xb4a30de9 (Missing)
34 gralloc.rk30board.so           0xb48f308b art::JValue art::interpreter::ExecuteGotoImpl<false, false>(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)
35 gralloc.rk30board.so           0xb4a131b5 art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::DexFile::CodeItem const*, art::ShadowFrame*)
36 gralloc.rk30board.so           0xb4c1973b artQuickToInterpreterBridge
37 gralloc.rk30board.so           0xb491d003 (Missing)
38 boot.oat                       0x73b4e2bb (Missing)

我看到很多关于 Fabric 的崩溃报告都有上面的日志,有没有办法理解它并找到解决方案?我已经在许多设备上进行了测试,但无法生成以上日志。在 7 天内,Fabric 控制台 上有大约 300 份崩溃报告。我刚刚在新更新中启用了 CrashlyticsNdk()。 谁能帮我找出问题所在。

谢谢。

最佳答案

经过长时间的调试,我在这里回答我自己的问题,我在我的 JNI 代码中发现了一个错误

旧代码

char signToken[endingNumber - startingNumber];
    int at = 0;
    for (int i = startingNumber; i < endingNumber; i++) {
        signToken[at] = cstr[i];
        at++;
    }
    signToken[at] = '\0';

新代码

 char signToken[endingNumber - startingNumber + 1];
    int at = 0;
    for (int i = startingNumber; i < endingNumber; i++) {
        signToken[at] = cstr[i];
        at++;
    }
    signToken[at] = '\0';

这是一个子字符串的简单登录,其中我的字符串大小等于字符串的长度,但在将大小更新为 N+1 后它的长度为字符串+1,我已经解决了我的问题。

关于android - 应用程序因 native 代码而崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47645640/

相关文章:

android - 解析推送第一次加载通知图标失败

java - 当没有值时,将值设置为空

android - 调用 GLSurfaceView.onPause() 后 Activity 暂停超时

android-ndk - Windows 上的 ndk-gdb

java - 在 64 位下调用 throw 时 JNI 代码因核心转储而崩溃

android - 我在哪里可以找到文件和android在JNI中写入

android - fragmentTransaction.add 和 fragmentTransaction.replace 之间的区别

android - 如何解决 Android 应用中的 Google 身份验证问题?

opencv - 带有 CDT 错误的 Opencv?

java - 我可以知道调用 JNI C 方法的类的名称吗?