삼성 SDK의 SLook 기능을 구현하려고합니다. 테스트에 사용되는 장치는 Samsung Galaxy prime 4G입니다. 토스트 오류에도 불구하고, 로그는 Try 블록 안에 오류 줄을 표시합니다. 앱 실행이 중단되면 오류가 발생합니다.java.lang.NoClassDefFoundError : 실패한 해결 방법 : Lcom/samsung/android/sdk/look/SlookImpl;
내가 사용 JAR 테스트 장치에 오류가 발생 Slook를 초기화
-: sdk-v1.0.0.jar
-: look_v1.3.1.jar
자바 코드입니다. 오류의
Slook slook = new Slook();
LinearLayout l = (LinearLayout) findViewById(R.id.information);
try {
slook.initialize(this);
} catch (SsdkUnsupportedException e) {
//l.addView(createTextView(e.toString()));
Toast.makeText(ICD.this, e.toString(), Toast.LENGTH_LONG).show();
return;
}
전체 스택 추적
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.a1technology.android, PID: 25097
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/samsung/android/sdk/look/SlookImpl;
at com.samsung.android.sdk.look.Slook.isSupportedDevice(Slook.java:160)
at com.samsung.android.sdk.look.Slook.initialize(Slook.java:137)
at com.a1technology.android.ICD.onCreate(ICD.java:60)
at android.app.Activity.performCreate(Activity.java:6178)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2648)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.samsung.android.sdk.look.SlookImpl" on path: DexPathList[[zip file "/data/app/com.a1technology.android-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.samsung.android.sdk.look.Slook.isSupportedDevice(Slook.java:160)
at com.samsung.android.sdk.look.Slook.initialize(Slook.java:137)
at com.a1technology.android.ICD.onCreate(ICD.java:60)
at android.app.Activity.performCreate(Activity.java:6178)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2648)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Suppressed: java.lang.ClassNotFoundException: com.samsung.android.sdk.look.SlookImpl
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 17 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
앱 Gradle을 구축 :
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.a1technology.android"
minSdkVersion 4
targetSdkVersion 4
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile files('libs/look_v1.3.1.jar')
compile files('libs/sdk-v1.0.0.jar')
}
APK에 두 개의 JAR을 모두 포함해야합니다. 질문을 수정하고'app/build.gradle'을 게시하십시오. – Robert
@ 로버트는 삼성 전자 디바이스가 Look Spen 용으로 사용해야하는 테스트 디바이스와 관련된 것입니다. –