【问题标题】:Validate resource references inside android XML files验证 android XML 文件中的资源引用
【发布时间】:2015-11-01 05:22:26
【问题描述】:

创建地图片段screen shot of error code时出错

【问题讨论】:

  • 我能知道您遇到什么类型的错误...?
  • 验证android XML文件中的资源引用@RajeshVijayaKumar
  • 你能从你的 logcat 中粘贴错误信息吗?所以它将帮助我确定解决方案......

标签: android google-maps android-fragments dictionary fragment


【解决方案1】:

由于我无法猜出您遇到的错误/问题,请确保您按照最低配置步骤在您的应用中创建地图视图...

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" />

【讨论】:

  • 谢谢问题解决了。早些时候我没有将播放服务库添加到 gradle 这就是为什么我得到这个错误现在解决了所有问题..@RajeshVijayakumar
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-09-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-05-09
相关资源
最近更新 更多