2016-12-04 76 views
1

我正在嘗試使用Google地圖製作簡單的應用。但是當我在模擬器中運行應用程序時,地圖不顯示,只顯示以下文本:「除非您更新Google Play服務,否則[應用程序的名稱]不會運行」。我使用Nougat 7.1(使用Google API)安裝了模擬器Nexus 5。我沒有在Google上找到解決方案。我可以在模擬器上運行Google地圖應用程序,還是必須在真實設備上測試?Android Google地圖不工作

更新:在的build.gradle:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 25 
buildToolsVersion "25.0.1" 
defaultConfig { 
    applicationId "com.malikbisic.mapsdemo" 
    minSdkVersion 21 
    targetSdkVersion 25 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.0.1' 
compile 'com.google.android.gms:play-services:10.0.1' 
testCompile 'junit:junit:4.12' 
} 

回答

0

那麼,你可以使用模擬器運行它,但要確保你的Android模擬器是運行基於Android 4.2.2谷歌的API平臺的AVD或更高。

檢查此thread和此video瞭解如何設置和使用Android模擬器來運行谷歌地圖。