简体   繁体   English

无法解析符号“ R”-将Eclipse项目导入Android Studio之后

[英]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.

相关问题 Android Studio:从 G​​ithub 导入项目并使用 gradle 文件重建/清理/同步后“无法解析符号 R” - Android Studio: "cannot resolve symbol R" after importing Project from Github and rebuilding/cleaning/syncing with gradle files 将gradle项目作为模块导入后,android studio无法解析Symbol R - android studio cannot resolve Symbol R after importing a gradle project as module 无法解析Symbol R(从Eclipse导入到Android Studio的项目) - Cannot resolve Symbol R (Imported project from Eclipse to Android Studio) 在新项目启动时,android studio无法解析符号R,在重建/清理后显示2个错误 - on new project start, android studio cannot resolve symbol R, after rebuild/clean shows 2 errors Android Studio-添加包后无法解析符号“ R” - Android Studio - Cannot resolve symbol 'R' after adding package 克隆项目后无法解析android中的符号“ R” - Cannot resolve symbol 'R' in android after cloning project Android Studio 2.2.3无法解析符号“ R” - Android Studio 2.2.3 Cannot resolve symbol 'R' Android Studio(1.1.0):-无法解析符号“ R” - Android Studio (1.1.0) :- Cannot resolve symbol 'R' Android Studio 中的“无法解析符号 R” - 'cannot resolve symbol R' in Android Studio Android studio 突然无法解析符号R - Android studio suddenly cannot resolve symbol R
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM