[英]Cannot Resolve The Symbol 'R' - After importing eclipse project to Android Studio
Please be gentle, I am moving my projects from Eclipse to Android Studio. 请放心,我正在将项目从Eclipse迁移到Android Studio。 The first issue is that all my activities now have problems resolving 'R'.
第一个问题是我的所有活动现在都无法解决“ R”。 I have a feeling that this is produced because the support library.
我感觉这是因为支持库产生的。 Generally I am using only the v.4 library but now in android studio I get the following error:
通常我只使用v.4库,但是现在在android studio中我收到以下错误:
/Users/vedtam/StudioProjects/foto.studio/fotostudio/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v11/values.xml Error:(47, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
/Users/vedtam/StudioProjects/foto.studio/fotostudio/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v11/values.xml错误:(47,21 )找不到与给定名称匹配的资源:attr'android:actionModeShareDrawable'。
/Users/vedtam/StudioProjects/foto.studio/fotostudio/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v14/values.xml Error:(17, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
/Users/vedtam/StudioProjects/foto.studio/fotostudio/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v14/values.xml错误:(17,21 )找不到与给定名称匹配的资源:attr'android:actionModeShareDrawable'。
/Users/vedtam/StudioProjects/foto.studio/fotostudio/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v21/values.xml Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
/Users/vedtam/StudioProjects/foto.studio/fotostudio/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v21/values.xml错误:(1)错误检索父项:找不到与给定名称“ android:TextAppearance.Material.Inverse”匹配的资源。 Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.
错误:(1)检索项目的父项时出错:未找到与给定名称“ android:TextAppearance.Material.Large.Inverse”匹配的资源。
build.gradle build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "foto.studio"
minSdkVersion 14
targetSdkVersion 18
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.android.support:support-v4:18.0.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/android-async-http-1.4.6.jar')
compile files('libs/braintree-api-1.6.1-full.jar')
compile files('libs/universal-image-loader-1.9.4-SNAPSHOT.jar')
}
Why am I getting these errors if I don't have the v.7 support library between the dependecies? 如果我在依赖之间没有v.7支持库,为什么会出现这些错误?
Thanks 谢谢
Some resources can't be resolved properly in values.xml for your various api versions from values-v11, values-14 and values-21
in the res directory of your app. 各种API版本的values.xml中的某些资源无法从app的res目录中的
values-v11, values-14 and values-21
正确解析。 That's the reason for the not resolving "R" issue. 这就是无法解决“ R”问题的原因。 Open those XML files and fix them then your AS will build fine.
打开这些XML文件并进行修复,然后您的AS会正常运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.