尝试获取字段ID时Android Jni出错

时间:2016-01-20 06:50:37

标签: android c++ java-native-interface field

我想获取签名数组,这是PackageInfo的一个字段。

我的C ++代码是(LOGD是一个用于记录的宏):

jclass PackageInfoClass = pEnv->FindClass("android/content/pm/PackageInfo");
if(PackageInfoClass == NULL) {
    LOGD("class PackageInfoClass not found");
    abort();
}
LOGD("class PackageInfoClass found");

jfieldID SignaturesFieldID = pEnv->GetFieldID(PackageInfoClass, "signatures",
        "[Landroid.content.pm.Signature;");
if(SignaturesFieldID == NULL) {
    LOGD("field SignaturesFieldID not found");
    abort();
}
LOGD("field SignaturesFieldID found");

在我的日志中,我收到消息“字段SignaturesFieldID not found”

0 个答案:

没有答案