如何纠正tools.MapsActivity到android.

时间:2016-12-01 10:29:45

标签: android google-maps

这是我的logcat

  

12-01 14:53:24.164 17910-17910 / com.swetha.pc.barcoderead   E / AndroidRuntime:致命异常:主要                                                                              处理:com.swetha.pc.barcoderead,PID:17910                                                                              java.lang.ClassCastException:   com.swetha.pc.barcoderead.tools.MapsActivity无法强制转换为   android.location.LocationListener                                                                                  在   com.swetha.pc.barcoderead.tools.MapsActivity.onMapReady(MapsActivity.java:265)                                                                                  在com.google.android.gms.maps.SupportMapFragment $ zza $ 1.zza(未知   资源)                                                                                  在com.google.android.gms.maps.internal.zzt $ zza.onTransact(未知   资源)                                                                                  在android.os.Binder.transact(Binder.java:380)                                                                                  在zu.a(:com.google.android.gms.DynamiteModulesB:82)                                                                                  at maps.ad.t $ 5.run(未知来源)                                                                                  在android.os.Handler.handleCallback(Handler.java:739)                                                                                  在android.os.Handler.dispatchMessage(Handler.java:95)                                                                                  在android.os.Looper.loop(Looper.java:135)                                                                                  在android.app.ActivityThread.main(ActivityThread.java:5273)                                                                                  at java.lang.reflect.Method.invoke(Native Method)                                                                                  在java.lang.reflect.Method.invoke(Method.java:372)                                                                                  在   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:903)                                                                                  在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)12-01   14:53:25.020 17910-20204 / com.swetha.pc.barcoderead I / b:收到的API   令牌:   AH0uPGEAVz4Fv0lIM1ZNa72XhP7ITCAK41eqC_INs_c63sE2LxzjlfURVrWkQ33r8PUe1ED9uW8HZEVSk6NjJG53kHmlU9iLrTrWXo57bcxPrqgeUEzTkfgKd9m6wuh93aolf3k47OakjOpk2uGiJtC8UNMq-VUQ8V4-HxgAA-ZQIrm_GsYUZXi42JEYrAG2k9IDosUy9xfJ   /到期时间:432000000ms 12-01 14:53:25.020   17910-20204 / com.swetha.pc.barcoderead I / c:安排下一次尝试   431700秒12-01 14:53:25.022   17910-20204 / com.swetha.pc.barcoderead W / f:抑制StrictMode   策略违规:StrictModeDiskWriteViolation 12-01 14:53:25.023   17910-20204 / com.swetha.pc.barcoderead I / d:已保存的身份验证令牌12-01   14:53:25.027 17910-20265 / com.swetha.pc.barcoderead W / f:抑制   StrictMode策略违规:StrictModeDiskReadViolation 12-01   14:53:26.070 17910-20198 / com.swetha.pc.barcoderead W / DynamiteModule:   本地模块描述符类   找不到com.google.android.gms.googlecertificates。 12-01   14:53:26.089 17910-20198 / com.swetha.pc.barcoderead I / DynamiteModule:   考虑本地模块com.google.android.gms.googlecertificates:0   和远程模块com.google.android.gms.googlecertificates:2 12-01   14:53:26.089 17910-20198 / com.swetha.pc.barcoderead I / DynamiteModule:   选定的com.google.android.gms.googlecertificates远程版本,   版本> = 2 12-01 14:53:26.093 17910-20198 / com.swetha.pc.barcoderead   E / DynamiteModule:无法加载DynamiteLoader:   java.lang.ClassNotFoundException:没找到类   " com.google.android.gms.dynamite.DynamiteModule $ DynamiteLoaderClassLoader"   在路径上:DexPathList [[zip文件   #&34; /data/app/com.swetha.pc.barcoderead-1/base.apk"],nativeLibraryDirectories = [/供应商/ lib中,   / system / lib]] 12-01 14:53:26.093 17910-20198 / com.swetha.pc.barcoderead   W / DynamiteModule:无法加载远程模块:无法获取模块   context 12-01 14:53:26.093 17910-20198 / com.swetha.pc.barcoderead   W / DynamiteModule:无法通过快速路由加载模块:远程加载   失败。没有发现本地回退。 12-01 14:53:26.096   17910-20198 / com.swetha.pc.barcoderead W / DynamiteModule:本地模块   com.google.android.gms.googlecertificates的描述符类没有   找到。 12-01 14:53:26.101 17910-20198 / com.swetha.pc.barcoderead   I / DynamiteModule:考虑本地模块   com.google.android.gms.googlecertificates:0和远程模块   com.google.android.gms.googlecertificates:2 12-01 14:53:26.101   17910-20198 / com.swetha.pc.barcoderead I / DynamiteModule:已选中   远程版本的com.google.android.gms.googlecertificates,版本

     
    

= 2

  

1 个答案:

答案 0 :(得分:1)

确保您的DataActivity实现com.google.android.gms.location.LocationListener而不是android.location.LocationListener。 您可能错误地导入了android.location.LocationListener。 不要施展它。

快乐编码