从我在Android NDK应用程序中的C代码,我正在尝试初始化Crashlytics但它返回NULL .

LOGW ("Initializing Crashlytics");
crashlyticsContext = crashlytics_init();
LOGI ("crashlyticsContext: %lx", (uint32_t) crashlyticsContext);

在logcat日志中,我收到了一个Permission Denial日志:

W/SimTalk: Initializing Crashlytics
W/ActivityManager: Permission Denial: getCurrentUser() from pid=18043, uid=10079 requires android.permission.INTERACT_ACROSS_USERS
I/SimTalk: crashlyticsContext: 0

我的build.gradle文件包含NDK的编译行:

compile('com.crashlytics.sdk.android:crashlytics-ndk:2.0.2@aar') {
    transitive = true
}

和崩溃论部分

crashlytics {
    enableNdk true
}

我的AndroidManifest.xml文件确实包含我的元数据:

<meta-data
    android:name="io.fabric.ApiKey"
    android:value="............omitted.............." />

你知道为什么我的crashlytics_init()不能正常工作吗?

Update: 我've determined that the dlopen() call in crashlytics_init() is returning NULL. The libcrashlytics.so file is included in the APK along with the other libs. It'仍然没有加载 .