当我使用.so文件android时找不到实现

时间:2019-03-11 03:06:58

标签: android android-ndk shared-libraries implementation .so

我想使用其他项目中的本机库。这是我的图书馆。 .so library

这是我第一次在android studio中使用ndk。我成功加载了.so库,但是当我想访问文件时失败。这是错误 error description

这是我加载库的Java代码。 jni

这是我的主要Java代码 main

你能解决我的问题吗?谢谢

2 个答案:

答案 0 :(得分:0)

您在C部分中缺少JNI层。为了使Java本机接口structure(list(Date_observed = structure(c(10L, 15L, 3L, 3L, 3L, 3L, 13L, 13L, 11L, 11L, 11L, 11L, 9L, 9L, 9L, 9L, 12L, 12L, 12L, 12L, 6L, 6L, 10L, 10L, 10L, 10L, 14L, 14L, 14L, 14L, 13L, 13L, 13L, 9L, 9L, 9L, 9L, 14L, 14L, 14L, 14L, 8L, 8L, 8L, 8L, 14L, 7L, 7L, 7L, 7L, 12L, 12L, 12L, 12L, 12L, 12L, 5L, 5L, 5L, 5L, 13L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 13L, 13L, 6L, 8L, 8L, 8L, 1L, 1L, 1L, 1L, 6L, 6L, 6L, 6L, 13L, 13L, 13L, 13L, 12L, 12L, 12L, 12L, 2L, 2L, 2L, 2L, 11L, 11L, 11L, 3L, 3L, 3L, 3L, 14L, 14L, 14L, 9L, 9L, 9L, 9L, 14L, 14L, 13L, 13L, 13L, 13L, 3L, 3L, 13L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 3L, 3L, 3L, 3L, 14L, 14L, 14L, 14L, 11L, 11L, 11L, 11L, 13L, 13L, 13L, 13L, 3L, 3L, 3L, 3L, 14L, 14L, 6L, 6L, 6L, 12L, 12L, 12L, 12L, 14L, 13L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 11L, 11L, 11L, 14L, 14L, 14L, 10L, 10L, 10L, 10L, 6L, 5L, 5L, 5L, 10L, 10L, 10L, 4L, 4L, 13L, 13L, 13L, 13L, 9L, 9L, 9L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 6L, 6L, 6L, 6L, 13L, 13L, 13L, 13L, 12L, 12L, 12L, 12L, 14L, 14L, 14L, 14L, 6L, 6L, 6L, 6L), .Label = c("10/23/18", "11/18/18", "11/30/18", "11/6/18", "12/1/18", "12/10/18", "12/12/18", "12/2/18", "12/3/18", "12/4/18", "12/6/18", "12/7/18", "12/8/18", "12/9/18", "9/10/18"), class = "factor"), Latitude = c(51.41752, 52.243806, 52.947709, 52.947709, 52.947709, 52.947709, 51.491811, 51.491811, 51.60157, 51.60157, 51.60157, 51.60157, 52.68959, 52.68959, 52.68959, 52.68959, 50.697802, 50.697802, 50.697802, 50.697802, 53.62417, 53.62417, 50.446841, 50.446841, 50.446841, 50.446841, 53.959679, 53.959679, 53.959679, 53.959679, 52.01434, 52.01434, 52.01434, 51.78375, 51.78375, 51.78375, 51.78375, 51.456965, 51.456965, 51.456965, 51.456965, 52.011812, 52.011812, 52.011812, 52.011812, 55.91924, 50.121978, 50.121978, 50.121978, 50.121978, 51.43474, 51.43474, 51.10708, 51.10708, 51.10708, 51.10708, 50.435984, 50.435984, 50.435984, 50.435984, 51.78666, 51.78666, 51.78666, 51.78666, 53.38728, 53.38728, 53.38728, 53.38728, 52.441088, 52.441088, 52.552344, 53.582285, 53.582285, 53.582285, 49.259471, 49.259471, 49.259471, 49.259471, 50.462, 50.462, 50.462, 50.462, 51.746642, 51.746642, 51.746642, 51.746642, 52.2501, 52.2501, 52.2501, 52.2501, 52.42646, 52.42646, 52.42646, 52.42646, 50.79387, 50.79387, 50.79387, 53.615575, 53.615575, 53.615575, 53.615575, 51.08478, 51.08478, 51.08478, 53.19329, 53.19329, 53.19329, 53.19329, 55.968437, 55.968437, 56.52664, 56.52664, 56.52664, 56.52664, 52.04252, 52.04252, 51.8113, 51.8113, 51.8113, 51.8113, 50.52008, 50.52008, 50.52008, 50.52008, 51.48417, 51.48417, 51.48417, 51.48417, 54.58243, 54.58243, 54.58243, 54.58243, 52.58839, 52.58839, 52.58839, 52.58839, 52.717283, 52.717283, 52.717283, 52.717283, 50.740764, 50.740764, 50.740764, 50.740764, 50.733412, 50.733412, 50.79926, 50.79926, 50.79926, 53.675788, 53.675788, 53.675788, 53.675788, 55.43828, 48.35079, 48.35079, 48.35079, 48.35079, 51.36445, 51.36445, 51.36445, 51.36445, 52.36286, 52.36286, 52.36286, 52.122402, 52.122402, 52.122402, 52.16104, 52.16104, 52.16104, 52.16104, 54.7311, 51.61842, 51.61842, 51.61842, 55.920966, 55.920966, 55.920966, 57.158724, 57.158724, 51.88468, 51.88468, 51.88468, 51.88468, 52.34015, 52.34015, 52.34015, 53.37687, 53.37687, 53.37687, 54.27745, 54.27745, 54.27745, 54.27745, 52.026042, 52.026042, 52.026042, 52.026042, 51.319032, 51.319032, 51.319032, 51.319032, 51.51365, 51.51365, 51.51365, 51.51365, 53.43202, 53.43202, 53.43202, 53.43202, 51.50797, 51.50797, 51.50797, 51.50797), Longitude = c(-0.32116, 1.30786, -1.435407, -1.435407, -1.435407, -1.435407, -3.210324, -3.210324, -3.67111, -3.67111, -3.67111, -3.67111, -3.3081, -3.3081, -3.3081, -3.3081, -2.11692, -2.11692, -2.11692, -2.11692, -2.43155, -2.43155, -3.706923, -3.706923, -3.706923, -3.706923, -1.061008, -1.061008, -1.061008, -1.061008, 1.04007, 1.04007, 1.04007, -0.65046, -0.65046, -0.65046, -0.65046, -2.624917, -2.624917, -2.624917, -2.624917, -0.70082, -0.70082, -0.70082, -0.70082, -3.20936, -5.555169, -5.555169, -5.555169, -5.555169, 0.45981, 0.45981, -2.32027, -2.32027, -2.32027, -2.32027, -4.105617, -4.105617, -4.105617, -4.105617, -0.71433, -0.71433, -0.71433, -0.71433, -2.95811, -2.95811, -2.95811, -2.95811, -0.176158, -0.176158, -1.337177, -2.802239, -2.802239, -2.802239, -123.107788, -123.107788, -123.107788, -123.107788, -3.5607, -3.5607, -3.5607, -3.5607, 0.486416, 0.486416, 0.486416, 0.486416, -0.8825, -0.8825, -0.8825, -0.8825, -1.78771, -1.78771, -1.78771, -1.78771, 0.26684, 0.26684, 0.26684, -2.432959, -2.432959, -2.432959, -2.432959, -0.73626, -0.73626, -0.73626, -0.63793, -0.63793, -0.63793, -0.63793, -3.179732, -3.179732, -3.40313, -3.40313, -3.40313, -3.40313, -2.43733, -2.43733, -0.22894, -0.22894, -0.22894, -0.22894, -4.20756, -4.20756, -4.20756, -4.20756, -0.34854, -0.34854, -0.34854, -0.34854, -5.93229, -5.93229, -5.93229, -5.93229, -1.96843, -1.96843, -1.96843, -1.96843, -2.410575, -2.410575, -2.410575, -2.410575, -2.361234, -2.361234, -2.361234, -2.361234, -2.014029, -2.014029, -3.19446, -3.19446, -3.19446, -1.272404, -1.272404, -1.272404, -1.272404, -4.64226, 10.91812, 10.91812, 10.91812, 10.91812, -0.23106, -0.23106, -0.23106, -0.23106, -2.06327, -2.06327, -2.06327, -0.487443, -0.487443, -0.487443, 0.18702, 0.18702, 0.18702, 0.18702, -5.8041, -0.16034, -0.16034, -0.16034, -3.193503, -3.193503, -3.193503, -2.166099, -2.166099, -0.17853, -0.17853, -0.17853, -0.17853, -1.27795, -1.27795, -1.27795, -1.34506, -1.34506, -1.34506, -0.47911, -0.47911, -0.47911, -0.47911, -0.503113, -0.503113, -0.503113, -0.503113, -0.472994, -0.472994, -0.472994, -0.472994, -3.18722, -3.18722, -3.18722, -3.18722, -2.27968, -2.27968, -2.27968, -2.27968, -0.25931, -0.25931, -0.25931, -0.25931), Altitude = c(0, 0, 103.9, 103.9, 103.9, 103.9, 15, 15, 184, 184, 184, 184, 176, 176, 176, 176, 12, 12, 12, 12, 178, 178, 36, 36, 36, 36, 11, 11, 11, 11, 47, 47, 47, 210, 210, 210, 210, 97, 97, 97, 97, 0, 0, 0, 0, 100, 68, 68, 68, 68, 4, 4, 200, 200, 200, 200, 160, 160, 160, 160, 165.8, 165.8, 165.8, 165.8, 0, 0, 0, 0, 0, 0, 0, 36, 36, 36, 47, 47, 47, 47, 0, 0, 0, 0, 43, 43, 43, 43, 97, 97, 97, 97, 133, 133, 133, 133, 18, 18, 18, 123, 123, 123, 123, 127, 127, 127, 15, 15, 15, 15, 14, 14, 65, 65, 65, 65, 45, 45, 129, 129, 129, 129, 18, 18, 18, 18, 30, 30, 30, 30, 19, 19, 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, 96, 96, 96, 96, 0, 0, 0, 0, 0, 49, 49, 49, 49, 0, 0, 0, 0, 0, 48, 48, 48, 48, 123, 123, 123, 43, 43, 43, 75, 75, 75, 75, 0, 73, 73, 73, 115, 115, 115, 119, 119, 94, 94, 94, 94, 112, 112, 112, 34, 34, 34, 0, 0, 0, 0, 103, 103, 103, 103, 0, 0, 0, 0, 37.5, 37.5, 37.5, 37.5, 29, 29, 29, 29, 63, 63, 63, 63), Species = structure(c(2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("Quercus petraea", "Quercus robur"), class = "factor"), Tree_diameter = c(68.8, 300, 847, 817, 569, 892, 62, 71, 29, 46.5, 27.7, 40.1, 68, 45, 60, 54, 104, 122, 85, 71, 81, 118, 39.8, 43.6, 44.6, 22.6, 19.8, 16.6, 15.1, 11.9, 48.1, 83.7, 77.9, 81.8, 102.5, 75.5, 57.3, 0.3, 0.2, 0.3, 0.3, 99, 85, 74, 68, 60, 67.3, 36.9, 82, 51.8, 19.9, 14.6, 196, 122, 118, 180, 58.6, 54.1, 58, 61.5, 58.4, 40.6, 61, 68.6, 117, 240, 210, 310, 134, 64, 52.2, 57, 73.9, 37.1, 170, 114, 127, 158, 147.4, 135.3, 122.9, 104.1, 263, 237, 322, 302, 173, 186, 144, 155, 89, 41, 68, 83, 81.5, 29.3, 43.3, 141.6, 85.5, 82.8, 114.1, 129, 127, 143, 125, 92, 68, 90, 25, 20, 63.7, 39.8, 66.2, 112.4, 41.9, 43.8, 124.5, 94.1, 68.6, 74.4, 24.2, 54.7, 43, 33.1, 306, 274, 56, 60, 72.5, 128.5, 22, 16, 143, 103, 53, 130, 48.4, 69.8, 6.4, 18.6, 129.2, 41.7, 57.6, 14, 320, 352, 120.9, 108.3, 53.2, 240, 274, 122, 85, 21, 52, 43, 38, 37, 219, 215, 216, 175, 124, 133, 119, 85.9, 49.7, 97.1, 40.8, 79.3, 62.4, 62.4, 70, 115.9, 111.1, 88.9, 73, 54, 75, 159, 244, 181.5, 149.7, 122, 143.6, 148, 145, 99, 49, 57.9, 54.8, 53.5, 88.8, 71.3,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L, 25L, 25L, 25L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 35L, 25L, 5L, 35L, 15L, 15L, 35L, 35L, 25L, 25L, 5L, 5L, 5L, 5L, 35L, 25L, 25L, 25L, 5L, 5L, 15L, 15L, 35L, 65L, 35L, 35L, 25L, 25L, 5L, 25L, 25L, 25L, 25L, 15L, 15L, 5L, 35L, 35L, 45L, 35L, 5L, 15L, 15L, 25L, 5L, 15L, 5L, 5L, 15L, 5L, 5L, 15L, 5L, 5L, 5L, 5L, 5L, 85L, 5L, 35L, 15L, 5L, 5L, 5L, 25L, 25L, 15L, 35L, 95L, 95L, 95L, 95L, 15L, 15L, 5L, 25L, 25L, 5L, 15L, 15L, 5L, 5L, 15L, 5L, 5L, 5L, 25L, 25L, 25L, 25L, 5L, 5L, 5L, 5L, 15L, 25L, 15L, 25L, 25L, 55L, 35L, 35L, 25L, 25L, 45L, 5L, 25L, 5L, 5L, 5L, 5L, 55L, 55L, 15L, 15L, 25L, 15L, 45L, 35L, 35L, 15L, 5L, 25L, 15L, 15L, 15L, 15L, 15L, 35L, 15L, 15L, 35L, 15L, 25L, 25L, 15L, 15L, 15L, 15L, 5L, 5L, 5L, 5L, 5L, 5L, 15L, 15L), Phenological_Index = c(4L, 4L, 3L, 4L, 4L, 3L, 2L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 2L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 4L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L)), class = "data.frame", row.names = c(NA, -215L )) 能够在C部分中找到匹配的函数,您需要使用GetLibVersion()定义一个C函数名称,就像崩溃日志告诉您的那样。不要错过C函数中的JNI参数。
如果要在C部分中具有与Java部分完全相同的函数名,则可以向JVM注册一个新名称。在您的JNI_Onload()中调用以下函数。

Java_ai_widya_mediatekso_JniLoader_GetLibVersion(JNIEnv *env, jobject thiz)

并且不要忘记在static int registerNativeMethods(JNIEnv* env) { jclass clazz; const char* className = "ai/widya/mediatekso/JniLoader"; clazz = env->FindClass(className); if (clazz == NULL) { ALOGE("Native registration unable to find class '%s'", className); return JNI_FALSE; } JNINativeMethod methods[] = { {"GetLibVersion", "()V", (void*) GetLibVersion }, {"GetProtoVersion", "()V", (void*) GetProtoVersion }, }; if (env->RegisterNatives(clazz, methods, 2) < 0) { ALOGE("RegisterNatives failed for '%s'", className); return JNI_FALSE; } return JNI_TRUE; } 这样的C函数中添加JNI参数。

答案 1 :(得分:0)

有了您在注释中提供的示例项目的link,生活真的很轻松。

您的项目中需要文件https://github.com/CassieLuoli/react-native-smartconnection/blob/master/android/src/main/java/com/mediatek/demo/smartconnection/JniLoader.java as is。从GitHub下载它,而无需更改类名或包,并像在example中一样在Java应用中使用它。