Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 에서 실행 시 ClassNotFound 오류 발생합니다. #149

Open
j7soft opened this issue Sep 5, 2024 · 1 comment
Open

Android 에서 실행 시 ClassNotFound 오류 발생합니다. #149

j7soft opened this issue Sep 5, 2024 · 1 comment
Assignees

Comments

@j7soft
Copy link

j7soft commented Sep 5, 2024

문제 설명

_전에 3.3.4 버전으로 잘 실행되던 앱인데 3.3.9로 버전을 올리고
앱을 실행하는데 전에 안 나던 에러가 자꾸 납니다.
에러 로그는 아래와 같습니다.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.inkosoft.popupbook, PID: 28299
java.lang.NoClassDefFoundError: Failed resolution of: Lkr/co/shineware/ds/aho_corasick/AhoCorasickDictionary;
at kr.co.shineware.nlp.komoran.modeler.model.Observation.init(Observation.java:41)
at kr.co.shineware.nlp.komoran.modeler.model.Observation.(Observation.java:37)
at kr.co.shineware.nlp.komoran.core.model.Resources.init(Resources.java:67)
at kr.co.shineware.nlp.komoran.core.Komoran.(Komoran.java:82)
at com.inkosoft.popupbook.MainActivity.(MainActivity.java:315)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
at android.app.Instrumentation.newActivity(Instrumentation.java:1378)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4034)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8919)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Caused by: java.lang.ClassNotFoundException: Didn't find class "kr.co.shineware.ds.aho_corasick.AhoCorasickDictionary" on path: DexPathList[[zip file "/data/app/~~jwz7PIZaaKtDy9JMcuR4pQ==/com.inkosoft.popupbook-LbgI8pj7LEZ_G8ghMKwy0w==/base.apk"],nativeLibraryDirectories=[/data/app/~~jwz7PIZaaKtDy9JMcuR4pQ==/com.inkosoft.popupbook-LbgI8pj7LEZ_G8ghMKwy0w==/lib/arm64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at kr.co.shineware.nlp.komoran.modeler.model.Observation.init(Observation.java:41) 
at kr.co.shineware.nlp.komoran.modeler.model.Observation.(Observation.java:37) 
at kr.co.shineware.nlp.komoran.core.model.Resources.init(Resources.java:67) 
at kr.co.shineware.nlp.komoran.core.Komoran.(Komoran.java:82) 
at com.inkosoft.popupbook.MainActivity.(MainActivity.java:315) 
at java.lang.Class.newInstance(Native Method) 
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) 
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) 
at android.app.Instrumentation.newActivity(Instrumentation.java:1378) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4034) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loopOnce(Looper.java:230) 
at android.os.Looper.loop(Looper.java:319) 
at android.app.ActivityThread.main(ActivityThread.java:8919) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) 

재현 경로

어떻게 하면 동일한 문제가 계속 발생하나요?
개발환경이 안드로이드 스튜디오입니다.
에러는 라이브러리를 초기화 하는 부분에서 나는 것 같습니다.
// KOMORAN 형태소분석기 모듈
import kr.co.shineware.nlp.komoran.constant.DEFAULT_MODEL;
import kr.co.shineware.nlp.komoran.core.Komoran;
import kr.co.shineware.nlp.komoran.model.KomoranResult;
import kr.co.shineware.nlp.komoran.model.Token;

// 형태소 분석기 생성
Komoran komoran = new Komoran(DEFAULT_MODEL.LIGHT);

기대 상황

정상적인 상황에서는 어떻게 동작해야 한다고 생각하세요?

환경 정보

어떤 환경에서 이 문제가 발생하였나요?

  • OS 종류 / 버전: Android targetSdkVersion 34
  • 브라우저 종류 및 버전:
  • Komoran 버전: 3.3.9
  • Java 버전: JDK 11

추가 정보

스크린샷이나 에러 로그 등, 추가 정보가 있다면 남겨주세요.
위 에러 로그 참고하십시요.

@gamamoe gamamoe self-assigned this Sep 6, 2024
@gamamoe
Copy link
Member

gamamoe commented Sep 6, 2024

@j7soft 리포트 감사합니다. 혹시 Gradle에서 KOMORAN 버전을 3.3.4로 변경하면 정상동작하나요? 간단한 HelloWorld App이지만 이전에 3.3.9로 설정된 프로젝트 실행 시 문제가 없었던 것을 확인했습니다 https://github.com/gamamoe/android-with-komoran 의존성 처리하는 과정에서 다른 문제가 있는 게 아닐까 싶기도 하네요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@gamamoe @j7soft and others