2016-09-27 86 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()),一切正常。