Android Studio中添加应用程序兼容性V7后的错误 [英] Error after adding AppCompat v7 in Android Studio

查看:174
本文介绍了Android Studio中添加应用程序兼容性V7后的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

添加应用程序兼容性V7库我得到的错误是R不能得到解决,这显然是由于这样的事实是R现在存在两次后。我找到了答案,在这里,问题:<一href=\"http://stackoverflow.com/questions/19632137/build-errors-after-adding-fullscreen-activity-in-android-studio\">Build Android Studio中添加全屏活动

After adding the appCompat v7 library I get the error that R cannot be resolved, which is apparently due to the fact that R now exists twice. I found an answer to that problem here : Build errors after adding fullscreen activity in Android Studio

不过,我没有或无法找到该文件attrs.xml中的\\ src \\主\\资源\\值\\ attrs.xml。是否有任何其他解决这一问题,或者有人可以给我怎么做,Android Studio中?

However, I dont have or cant find the file attrs.xml in \src\main\res\values\attrs.xml. Is there any other solution to that problem or can someone give me a detailed description of how to do that in Android Studio?

非常感谢你!

推荐答案

将这个:

dependencies {
    compile 'com.android.support:support-v4:18.0.0'
    compile 'com.android.support:appcompat-v7:18.0.0'
}

和确保版本code(这里18.0.0)是在同一个文件比buildToolsVersion不高于:

and make sure the version code (here 18.0.0) is not higher than the buildToolsVersion in the same file :

android {
    compileSdkVersion 16
    buildToolsVersion "18.0.0"
}

然后重建项目。希望帮助!
噢,并确保你有通过SDK管理器中安装了正确的编译工具!实际的版本是21.0.2,我认为。

then rebuild your project. Hope that helps! Oh and make sure you have the right buildTools installed via SDK Manager! Actual version is 21.0.2 I think.

这篇关于Android Studio中添加应用程序兼容性V7后的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆