当我在android Studio中集成OpenCV进行眼睛检测时。集成后消息打印Opencv安装成功消息生成,但出现错误。
无法从加载器加载detection_based_trackerdalvik.system.PathClassLoader[DexPathList[[zip file"/data/app/com.example.admin.lanskart-2.apk],nativeLibraryDirectory=[/data/app-lib/com.example.admin.lanskart-2,/供应商/lib,/system/lib]]]: findGallery返回空
Process: com.example.admin.lanskart, PID: 24341
java.lang.UnsatisfiedLinkError: Couldn't load detection_based_tracker from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.admin.lanskart-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.admin.lanskart-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:553)
at com.example.admin.lanskart.MainActivity$1.onManagerConnected(MainActivity.java:69)
at org.opencv.android.AsyncServiceHelper$3.onServiceConnected(AsyncServiceHelper.java:319)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1140)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1157)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
您需要在gradle中定义jni源的目录。你的应用程序gradle应该是这样的:
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 22
buildToolsVersion = "23.0.0"
defaultConfig.with {
applicationId = "enter.your.packagename"
minSdkVersion.apiLevel = 10
targetSdkVersion.apiLevel = 22
versionCode = 1
versionName = "1.0"
}
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file('proguard-rules.pro')
}
}
/*
* native build settings
*/
android.ndk {
moduleName = "ndklibrarysample"
cppFlags += ["-std=c++11", "-fexceptions", "-frtti"]
cppFlags += "-I${file("D:yourpathtothesefiles/OpenCV-3.0.0-android-sdk-1/OpenCV-android-sdk/sdk/native/jni/include")}".toString()
ldLibs += ["android", "EGL", "GLESv2", "dl", "log", "z"]
stl = "gnustl_static"
}
android.productFlavors {
create("arm") {
ndk.with {
abiFilters += "armeabi"
File curDir = file('./')
curDir = file(curDir.absolutePath)
String libsDir = curDir.absolutePath + "\\src\\main\\jniLibs\\armeabi\\"
ldLibs += libsDir + "libopencv_java3.so"
}
}
create("armv7") {
ndk.with {
abiFilters += "armeabi-v7a"
File curDir = file('./')
curDir = file(curDir.absolutePath)
String libsDir = curDir.absolutePath + "\\src\\main\\jniLibs\\armeabi-v7a\\"
ldLibs += libsDir + "libopencv_java3.so"
}
}
create("x86") {
ndk.with {
abiFilters += "x86"
File curDir = file('./')
curDir = file(curDir.absolutePath)
String libsDir = curDir.absolutePath + "\\src\\main\\jniLibs\\x86\\"
ldLibs += libsDir + "libopencv_java3.so"
}
}
create("mips") {
ndk.with {
abiFilters += "mips"
File curDir = file('./')
curDir = file(curDir.absolutePath)
String libsDir = curDir.absolutePath + "\\src\\main\\jniLibs\\mips\\"
ldLibs += libsDir + "libopencv_java3.so"
}
}
create("fat") {
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile project(':libraries:opencv')
}
并将您的类路径从project gradle文件更改为此版本,并确保ndk路径为您的本地路径。属性文件
classpath 'com.android.tools.build:gradle-experimental:0.2.0'
我的预览在方法中调用时返回null。测试类确实扩展了,因为它被保存在
我无法理解为什么findFragmentByTag()在我的代码中返回null。我已经在片段onCreate()上设置了RetainInstance(true),并且正在使用getSupportFragmentManager()。findFragmentByTag(),因为它是SherlockFragmentActivity。 这是我的活动代码: } 这是我的片段代码:
下面是我的控制器代码:- 以下是我的服务代码:- 下面是我的存储库代码:-
我正在尝试检索一个带有Android特定注释的类列表。我正在尝试使用反射库来完成此操作。但无论我做什么,Reflections都返回一个空集。最后,我尝试使用Reflections.getAllTypes(),它应该返回包中的所有类,它给我的消息是“Could not find subtypes of Object.nake SubTypesScanner initialized to inclu
我试图获取一个列表从数据库和findAll()返回空列表。我有多个jpa存储库,但只有一个不工作。这是代码: 这就是实体: 当我调用product类别epository.findAll()时,它返回空列表,因此我在数据库中有许多条目。谢谢你的帮助!
这一行是: 我在和上尝试了和,但仍然给出相同的错误