繁体   English   中英

找不到方法glt.a引用的类'com.google.android.gms.location.internal.ParcelableGeofence

[英]Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence referenced from method glt.a

我有一个应用程序,其中主页是地图。

不知道为什么我会收到此错误以及与此错误一起Could not find class 'gpr', referenced from method gps.a

我已经更新了Eclipse,因此我尝试使用新的SHA1指纹更改为API密钥。 但这不起作用。

当您打开应用程序时,我的应用程序将显示当前位置。 它只是落入整个地图,但在LOG cat中却出现了这些错误。 这是我的Logcat

`07-08 12:54:39.897: I/Google Maps Android API(25749): Google Play services client version: 5077000

 07-08 12:54:39.907: I/dalvikvm(25749): Could not find method guj.a, referenced from method gqi.a

 07-08 12:54:39.907: W/dalvikvm(25749): VFY: unable to resolve static method 24936: Lguj;.a (Landroid/content/Context;)Lgri;

 07-08 12:54:39.907: D/dalvikvm(25749): VFY: replacing opcode 0x71 at 0x0003

 07-08 12:54:39.917: E/dalvikvm(25749): Could not find class 'gpr', referenced from method gps.a

 07-08 12:54:39.917: W/dalvikvm(25749): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;

 07-08 12:54:39.917: D/dalvikvm(25749): VFY: replacing opcode 0x22 at 0x0000

 07-08 12:54:39.927: E/dalvikvm(25749): Could not find class 'gpr', referenced from method gps.a

 07-08 12:54:39.927: W/dalvikvm(25749): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;

 07-08 12:54:39.927: D/dalvikvm(25749): VFY: replacing opcode 0x22 at 0x0000

 07-08 12:54:39.927: E/dalvikvm(25749): Could not find class 'gpr', referenced from method gps.a

 07-08 12:54:39.927: W/dalvikvm(25749): VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;

 07-08 12:54:39.927: D/dalvikvm(25749): VFY: replacing opcode 0x22 at 0x0000

 07-08 12:54:39.937: D/dalvikvm(25749): DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a

 07-08 12:54:39.937: D/dalvikvm(25749): DexOpt: unable to opt direct call 0x5ea3 at 0x0c in Lgps;.a

 07-08 12:54:39.937: D/dalvikvm(25749): DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a

 07-08 12:54:39.957: I/Google Maps Android API(25749): Google Play services package version: 5084034

 07-08 12:54:39.977: W/dalvikvm(25749): VFY: unable to resolve static field 20873 (t) in Lyp;

 07-08 12:54:39.977: D/dalvikvm(25749): VFY: replacing opcode 0x62 at 0x000e
 07-08 12:54:39.977: W/dalvikvm(25749): VFY: unable to resolve static field 20873 (t) in Lyp;

 07-08 12:54:39.977: D/dalvikvm(25749): VFY: replacing opcode 0x62 at 0x000d

 07-08 12:54:40.888: I/dalvikvm(25749): Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lgln;'

 07-08 12:54:40.888: W/dalvikvm(25749): Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed

 07-08 12:54:40.898: E/dalvikvm(25749): Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a

 07-08 12:54:40.898: W/dalvikvm(25749): VFY: unable to resolve check-cast 2086 (Lcom/google/android/gms/location/internal/ParcelableGeofence;) in Lglt;

 07-08 12:54:40.898: D/dalvikvm(25749): VFY: replacing opcode 0x1f at 0x0019

 07-08 12:54:41.589: W/ActivityThread(25749): ClassLoader.loadClass: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());`

我尝试使用Google进行搜索,似乎还没有适当的解决方案,因此如果有人可以帮助我,这将是有帮助的。

我向您展示如何解决您遇到的相同问题。

首先,我清理了所有SDK,然后再次下载了Google Play服务库。 然后,我删除了计算机的.android文件夹,并重新生成了debug.keystore。

之后,我只需获取新的SHA1即可获取我的Google Maps V2 Api密钥。

更新我的apikey之后,让我们看看如何更改代码。

现在,在您的xml布局中,将片段与MapView插入的MapFragment一起使用。

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MapsActivity" >

    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.MapFragment" />

</RelativeLayout> 

并使用FragmentManager找到它:

    public class MapsActivity extends Activity
{
    private GoogleMap map;

    @Override
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map);

        // Gets the MapView from the XML layout and creates it
        map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
        map.getUiSettings().setMyLocationButtonEnabled(false);
        //map.setMyLocationEnabled(true);
        map.setOnMapClickListener(this);
        map.setOnMapLongClickListener(this);
        try 
        {
            MapsInitializer.initialize(MapsActivity.this);
        } 
        catch (Exception e) 
        {
            e.printStackTrace();
        }
    }

希望对我有帮助,如果我的英语不好,抱歉

在7月升级到API级别23(使用客户端google-play-service_lib 5.0.77)后,我遇到了同样的问题。

将Google Play服务更新到测试设备上的最新版本(6.1.09)后,此问题已解决。

因此,这似乎是(特定于设备的问题),原因是设备/仿真器上的Google Play服务版本与项目中的客户端库API(google-play-service_lib)不兼容。

根据Google的文档,当客户端比服务新时,客户端库API应该可以解决过时的服务apk问题。 (并且在这种情况下也是如此,因为问题实际上并没有影响已发布的APK) https://developer.android.com/google/play-services/index.html

我之前尝试通过使用新的API密钥和新安装的Eclipse / ADT / SDK / google-play-service_lib来解决此问题,但此问题和其他类似问题中的建议均无效。

您可以张贴清单吗? 当然,Sans API密钥。

对于我最近遇到的问题,您的日志看上去几乎与我的日志相同,此问题已通过在清单中添加以下内容来解决:

 <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

我正在开发一种可以正常访问地图,然后突然停止运行的应用程序。 我看不到任何实际上指向缺少权限的内容; 我将清单与另一个使用maps api v2的应用程序进行比较时才了解它。

对于为什么以前没有它,我仍然感到困惑(Google表示您需要获得地图的许可才能工作)。 也许我曾经把它放在那儿,然后不小心删除了那条线,但是把它放进去的任何一种方式都可以解决它。

来源: https//developers.google.com/maps/documentation/business/mobile/android/config

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM