1

我正在尝试根据谷歌的新要求将我的旧版 android 应用程序升级到android API 级别 26 。不幸的是, GoogleMap API V1集成在自Android API Level 22 起已被删除的应用程序中。

通过使用 maps.jar 依赖项,我设法将GoogleMap API V1与 android API Level 26 一起使用。

它仅在我直接从 android studio 运行项目时才有效,但是当我在应用程序的发布/分发构建后从 apk 安装它时,应用程序会崩溃。以下是错误日志:

2018-10-22 18:24:29.581 18509-18509/com.gsccca.mapsearch E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.gsccca.mapsearch, PID: 18509
    java.lang.IncompatibleClassChangeError: Structural change of com.google.android.maps.MapActivity is hazardous (/data/app/com.gsccca.mapsearch-1/oat/arm64/base.odex at compile time, /system/framework/oat/arm64/com.google.android.maps.odex at runtime): Virtual method count off: 8 vs 9
    Lcom/google/android/maps/MapActivity; (Compile time):
     Static fields:
     Instance fields:
     Direct methods:
      <init>()V
     Virtual methods:
      isLocationDisplayed()Z
      isRouteDisplayed()Z
      onCreate(Landroid/os/Bundle;)V
      onDestroy()V
      onGetMapDataSource()I
      onNewIntent(Landroid/content/Intent;)V
      onPause()V
      onResume()V
    Lcom/google/android/maps/MapActivity; (Runtime):
     Static fields:
      I MAP_DATA_SOURCE_CHINA
      I MAP_DATA_SOURCE_DEFAULT
      Ljava/util/Map; drawableIdMap
      Ljava/lang/ref/WeakReference; sActivityReference
      Ljava/lang/ref/WeakReference; sMapReference
     Instance fields:
      Landroid_maps_conflict_avoidance/com/google/common/android/AndroidConfig; mConfig
      Landroid_maps_conflict_avoidance/com/google/googlenav/datarequest/DataRequestDispatcher; mDataRequestDispatcher
      Landroid_maps_conflict_avoidance/com/google/googlenav/map/Map; mMap
      Lcom/google/android/maps/MapView; mMapView
      Landroid/os/Handler; mNetworkHandler
      Lcom/google/android/maps/NetworkConnectivityListener; mNetworkWatcher
      Landroid_maps_conflict_avoidance/com/google/googlenav/map/TrafficService; mTrafficService
     Direct methods:
      -get0(Lcom/google/android/maps/MapActivity;)Landroid_maps_conflict_avoidance/com/google/common/android/AndroidConfig;
      -get1(Lcom/google/android/maps/MapActivity;)Landroid_maps_conflict_avoidance/com/google/googlenav/datarequest/DataRequestDispatcher;
      -get2(Lcom/google/android/maps/MapActivity;)Lcom/google/android/maps/NetworkConnectivityListener;
      <clinit>()V
      <init>()V
      createMap()V
      getServerUrl()Ljava/lang/String;
      restoreGlobalState()V
      sendStartSession()V
      setupTileDensity()V
     Virtual methods:
      isLocationDisplayed()Z
      isRouteDisplayed()Z
      onCreate(Landroid/os/Bundle;)V
      onDestroy()V
      onGetMapDataSource()I
      onNewIntent(Landroid/content/Intent;)V
      onPause()V
      onResume()V
      setupMapView(Lcom/google/android/maps/MapView;)V
     (declaration of 'com.gsccca.mapsearch.SearchNearMeActivity' appears in /data/app/com.gsccca.mapsearch-1/base.apk)
        at com.gsccca.mapsearch.HomeActivity.onClick(HomeActivity.java:382)
        at android.view.View.performClick(View.java:5612)
        at android.view.View$PerformClick.run(View.java:22285)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6154)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

项目依赖

**项目依赖**

4

0 回答 0