java.lang.NoSuchFieldError:没有类型为Lcom / google / android / gms / internal / zzsb $ zzb的静态字段KL

时间:2017-08-07 14:36:53

标签: java android google-play-services

我正在尝试在Android上打开相机活动,但是当活动开始时我收到了这个错误:

FATAL EXCEPTION: main
  Process: bookreader.bookreader, PID: 19132
 java.lang.NoSuchFieldError: No static field KL of type Lcom/google/android/gms/internal/zzsb$zzb; in class Lcom/google/android/gms/internal/zzsb; or its superclasses (declaration of 'com.google.android.gms.internal.zzsb' appears in /data/app/bookreader.bookreader-1/split_lib_dependencies_apk.apk:classes4.dex)
at com.google.android.gms.vision.text.internal.client.zze.zzcic(Unknown Source)
at com.google.android.gms.vision.text.internal.client.zze.<init>(Unknown Source)
at com.google.android.gms.vision.text.TextRecognizer$Builder.build(Unknown Source)
at bookreader.bookreader.CameraActivity.onCreate(CameraActivity.java:97)
at android.app.Activity.performCreate(Activity.java:6609)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3113)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3275)
at android.app.ActivityThread.access$1000(ActivityThread.java:218)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1744)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:7007)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

我不知道如何解决它。在我的Android Manifest中,我有这个:

 <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

1 个答案:

答案 0 :(得分:0)

确保build.gradle中的所有内容都是最新的

由于依赖版本不匹配,通常不会发生此类方法/字段/类错误(模糊字段名称可能因版本而异)