2016-09-27 37 views
-1

我的應用在版本com.google.android.gms上使用谷歌地圖2年:play-services:5.0.89。當我嘗試升級時,該應用程序將不顯示GUI,只顯示空白屏幕。谷歌播放服務升級後的空白屏幕

可能與here的問題相同,但沒有解決方法,但是降級。

我已經試過

compile 'com.google.android.gms:play-services:9.6.0' 

,也只是子集,我不使用其他服務

compile 'com.google.android.gms:play-services-maps:9.6.0' 
compile 'com.google.android.gms:play-services-analytics:9.6.0' 

下面是完整的腳本的gradle2天花了禁止複製

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "24.0.0" 

    defaultConfig { 
     applicationId "cz.benhur.vfrdroid" 
     minSdkVersion 17 
     targetSdkVersion 23 
     versionCode 12 
     versionName "1.12" 

     // http://developer.android.com/tools/building/multidex.html 
     //multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/NOTICE.txt' 
    } 

    compileOptions { 
//  sourceCompatibility JavaVersion.VERSION_1_7 
//  targetCompatibility JavaVersion.VERSION_1_7 
    } 

    testOptions { 
     unitTests.returnDefaultValues = true 
    } 
} 

dependencies { 
    //compile 'com.android.support:multidex:1.0.0' 
    compile 'com.android.support:support-v13:23.4.0' 
    compile fileTree(dir: 'libs', include: ['*.jar']) 

    compile 'com.google.android.gms:play-services-maps:9.6.0' 
    compile 'com.google.android.gms:play-services-analytics:9.6.0' 

    // MPAndroidChart, geodesy: apache2 license 
    compile 'com.dropbox.core:dropbox-core-sdk:2.1.1' 
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.2' 
    compile 'org.gavaghan:geodesy:1.1.3' 

    //testCompile 'junit:junit:4.12' 
} 

回答

0

後將我的代碼逐個粘貼到新項目中我發現問題:

  1. 我的應用程序有2個地圖片段。我曾經在setUpMapIfNeeded()中的每個元素上調用getMap()。我必須更新getMapAsync()。
  2. setUpMapIfNeeded()是從onCreate()和onResume()中調用的。這可能是2年前由Android Studio產生的。

如果我刪除第二個setUpMapIfNeeded()(或第二個getMapAsync()),一切正常。