괴수
30
2020-05-19 23:43:50 작성 2020-05-20 06:49:14 수정됨
0
264

안드로이드스튜디오에서 ML kit의 한국어 인식 연동 오류 질문



private void identifyLanguage(final String inputText) {
        FirebaseLanguageIdentification languageIdentifier = FirebaseNaturalLanguage.getInstance().getLanguageIdentification();
        languageIdentifier.identifyLanguage((String) text).addOnSuccessListener(
                        new OnSuccessListener<String>() {
                            @Override
                            public void onSuccess(@NonNull String languageCode) {
                                if (languageCode != "und") {
                                    Log.i(TAG, "Language: " + languageCode);
                                } else {
                                    Log.i(TAG, "Can't identify language.");
                                }
                            }
                        })
                .addOnFailureListener(
                        new OnFailureListener() {
                            @Override
                            public void onFailure(@NonNull Exception e) {
                                // Model couldn’t be loaded or other internal error.
                                // ...
                            }
            

ML Kit을 이용하여 간판 인식 프로그램을 만들고 있는데 한국어 인식을 위해서 위의 코드를 추가했더니 핸드폰에 설치 후 실행시키면 앱이 중지되었다는 문구와 함께 종료가 되는 오류가 생깁니다.

어떻게 해결할 수 있을까요??

아래는 로그캣 결과입니다.

2020-05-19 23:21:49.265 18028-18028/? E/Zygote: isWhitelistProcess - Process is Whitelisted

2020-05-19 23:21:49.266 18028-18028/? E/libpersona: scanKnoxPersonas

2020-05-19 23:21:49.267 18028-18028/? E/libpersona: Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory

2020-05-19 23:21:50.445 18028-18028/com.example.ashwin.textdetector E/AndroidRuntime: FATAL EXCEPTION: main

    Process: com.example.ashwin.textdetector, PID: 18028

    java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.example.ashwin.textdetector-YiB1VsEVclsnJ8VD-JJS9g==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.ashwin.textdetector-YiB1VsEVclsnJ8VD-JJS9g==/lib/arm64, /data/app/com.example.ashwin.textdetector-YiB1VsEVclsnJ8VD-JJS9g==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]

        at android.app.ActivityThread.installProvider(ActivityThread.java:6581)

        at android.app.ActivityThread.installContentProviders(ActivityThread.java:6133)

        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6043)

        at android.app.ActivityThread.-wrap1(Unknown Source:0)

        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)

        at android.os.Handler.dispatchMessage(Handler.java:105)

        at android.os.Looper.loop(Looper.java:164)

        at android.app.ActivityThread.main(ActivityThread.java:6944)

        at java.lang.reflect.Method.invoke(Native Method)

        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.example.ashwin.textdetector-YiB1VsEVclsnJ8VD-JJS9g==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.ashwin.textdetector-YiB1VsEVclsnJ8VD-JJS9g==/lib/arm64, /data/app/com.example.ashwin.textdetector-YiB1VsEVclsnJ8VD-JJS9g==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]

        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

        at android.app.ActivityThread.installProvider(ActivityThread.java:6566)

        at android.app.ActivityThread.installContentProviders(ActivityThread.java:6133) 

        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6043) 

        at android.app.ActivityThread.-wrap1(Unknown Source:0) 

        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764) 

        at android.os.Handler.dispatchMessage(Handler.java:105) 

        at android.os.Looper.loop(Looper.java:164) 

        at android.app.ActivityThread.main(ActivityThread.java:6944) 

        at java.lang.reflect.Method.invoke(Native Method) 

        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 

    Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.example.ashwin.textdetector-YiB1VsEVclsnJ8VD-JJS9g==/base.apk because: Failure to verify dex file '/data/app/com.example.ashwin.textdetector-YiB1VsEVclsnJ8VD-JJS9g==/base.apk': Bad method handle type 7

        at dalvik.system.DexFile.openDexFileNative(Native Method)

        at dalvik.system.DexFile.openDexFile(DexFile.java:353)

        at dalvik.system.DexFile.<init>(DexFile.java:100)

        at dalvik.system.DexFile.<init>(DexFile.java:74)

        at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)

        at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)

        at dalvik.system.DexPathList.<init>(DexPathList.java:157)

        at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)

        at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)

        at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)

        at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)

        at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36)

        at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:678)

        at android.app.LoadedApk.getClassLoader(LoadedApk.java:711)

        at android.app.LoadedApk.getResources(LoadedApk.java:944)

        at android.app.ContextImpl.createAppContext(ContextImpl.java:2303)

        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5943)

        ... 8 more


0
  • 답변 0

  • 로그인을 하시면 답변을 등록할 수 있습니다.