google maps - Add Two library in android studio -
my application working fine in android studio when added library of google map.showing error.
package com.iremember.kiet; import android.app.fragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import com.google.android.gms.maps.googlemap; //no error import info.androidhive.slidingmenu.r;// cannot resolve symbol r (when added library of google map)
build.gradle
apply plugin: 'com.android.application' android { compilesdkversion 18 buildtoolsversion "21.1.2" defaultconfig { applicationid "info.androidhive.slidingmenu" minsdkversion 11 targetsdkversion 17 } buildtypes { debug { debuggable true } release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:18.0.0' compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.google.android.gms:play-services:6.5.87' }
the error " cannot resolve symbol r" comming after added google lib
step 1(optional helpful):
this java , not c or c++, stop trying memorize imports.
you using android studio based off intellij, turn on optimize imports: https://www.jetbrains.com/idea/help/optimizing-imports.html
step 2:
sync , clean project.
step 3:
without doubt, need target latest libs, these sdk manager:
apply plugin: 'com.android.application' android { compilesdkversion 22 // <-- 18 buildtoolsversion "22.0.0" // <-- 21.1.2 defaultconfig { applicationid "info.androidhive.slidingmenu" minsdkversion 11 targetsdkversion 22 // <-- 17 } buildtypes { // <-- debug debuggable default release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:22.0.0' // <-- 18 compile 'com.android.support:appcompat-v7:22.0.0' // <-- 21.0.3 compile 'com.google.android.gms:play-services:6.5.87' }
Comments
Post a Comment