android com.google.firebase.ml.common.FirebaseMLException:执行Firebase ML任务proguard时发生内部错误

mbzjlibv  于 2023-10-14  发布在  Android
关注(0)|答案(1)|浏览(94)

文本识别可以在调试构建时工作,但在发布时我得到的错误:

com.google.firebase.ml.common.FirebaseMLException: Internal error has occurred when executing Firebase ML tasks
                                                                                                        at ok.a8.run(SourceFile:20)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:942)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:226)
                                                                                                        at android.os.Looper.loop(Looper.java:313)
                                                                                                        at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                                    Caused by: java.lang.IllegalArgumentException: 
                                                                                                        at ok.a2.c(SourceFile:1079)
                                                                                                        at ok.a2.b(SourceFile:19)
                                                                                                        at com.google.android.gms.internal.firebase_ml.b.f(SourceFile:1853)
                                                                                                        at ok.u8.e(SourceFile:123)
                                                                                                        at ok.v8.d(SourceFile:5)
                                                                                                        at gl.g2.call(SourceFile:134)
                                                                                                        at ok.a8.run(SourceFile:5)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:942) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:226) 
                                                                                                        at android.os.Looper.loop(Looper.java:313) 
                                                                                                        at android.os.HandlerThread.run(HandlerThread.java:67) 
                                                                                                    Caused by: java.lang.IllegalArgumentException: unable to create new instance of class ok.o3 because it is abstract and because it has no accessible default constructor
                                                                                                        at ok.b.g(SourceFile:173)
                                                                                                        at ok.b.F(SourceFile:7)
                                                                                                        at ok.l2.i(SourceFile:26)
                                                                                                        at ok.a2.c(SourceFile:669)
                                                                                                        at ok.a2.b(SourceFile:19) 
                                                                                                        at com.google.android.gms.internal.firebase_ml.b.f(SourceFile:1853) 
                                                                                                        at ok.u8.e(SourceFile:123) 
                                                                                                        at ok.v8.d(SourceFile:5) 
                                                                                                        at gl.g2.call(SourceFile:134) 
                                                                                                        at ok.a8.run(SourceFile:5) 
                                                                                                        at android.os.Handler.handleCallback(Handler.java:942) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:226) 
                                                                                                        at android.os.Looper.loop(Looper.java:313) 
                                                                                                        at android.os.HandlerThread.run(HandlerThread.java:67) 
                                                                                                    Caused by: java.lang.InstantiationException: java.lang.Class<ok.o3> cannot be instantiated
                                                                                                        at java.lang.Class.newInstance(Native Method)

问题出在网络配置中:您需要将这一行添加到proguard配置:

-keep class com.google.android.gms.internal.firebase_ml.** { *; }

这修复了Relase版本中的问题

oxcyiej7

oxcyiej71#

问题出在网络配置中:您需要将这一行添加到proguard配置:

-keep class com.google.android.gms.internal.firebase_ml.** { *; }

这修复了Relase版本中的问题

相关问题