我在创建地图片段screen shot of error code
时遇到错误答案 0 :(得分:0)
由于我无法猜测您遇到的错误/问题,请确保您遵循此最小配置步骤在您的应用中创建地图视图...
Step 1 :
Import / add google play service library as dependencies in gradle of your android studio project.
dependencies {
compile 'com.google.android.gms:play-services:6.5.87'
}
Step 2 :
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Step 3 :
<!--Permissions-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--Google MAP API key-->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_API_KEY" />
Step 4
:
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />