无法在Android版本4.1中显示谷歌地图,而地图在Android高于版本5中可见

时间:2016-10-15 11:11:14

标签: android google-maps

在此我已经实现了google的firebase服务,之前我没有使用firebase服务,所以我的编译时间是com.google.android.gms:play-services-location:8.3.0'它在4.1和所有其他版本的Android和现在becoz的firebase服务工作得很好,我无法在Android 4.1中看到地图becoz我必须将谷歌播放服务的版本升级到9.4.0

build.gradle文件

$scope.pickWord = function(w, i){
    if(!$scope.selectedItems){
       $scope.selectedItems = [];
    }

    var index = $scope.selectedItems.indexOf(i);

    if(index === -1) {   // not selected already and add
       $scope.selectedItems.push(i);
        $scope.playerAnswer += w;
    } else {   // selected already and remove
       $scope.selectedItems.splice(index, 1);
       $scope.playerAnswer = $scope.playerAnswer.replace(w, "");
    }
}

$scope.clear = function(){
   $scope.selectedItems = [];
};

1 个答案:

答案 0 :(得分:0)

首先,删除行'com.google.android.gms:play-services:9.4.0',因为它会将所有Google Play和Firebase库添加到您的应用中。它还会增加构建时间和APK文件的大小。因此,请将其替换为您只需要的库。以下是Google Play图书馆的link。这是Firebase库的link

最后,我没有看到谷歌地图库,似乎你忘了包含它。

com.google.android.gms:play-services-maps:9.4.0

在使用Firebase时,请确保您的类路径是这样的,因为有时这是问题所在。

buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:3.0.0'
}
}