我可以修复Android.Support.V7.App.Appcompatactivity的破坏依赖性; [英] Hox Can I Fix A Broken Dependency Of Android.Support.V7.App.Appcompatactivity;

查看:480
本文介绍了我可以修复Android.Support.V7.App.Appcompatactivity的破坏依赖性;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Codeprojecters,



今天我开始学习使用Java编写Android版本。



我使用Android-Studio生成初始代码。但是,如果我打开我的MainActivity.java,我已经看到它使用了import android.support.v7.app.AppCompatActivity;包含AppCompatActivity作为依赖项。 IDE告诉我它无法解析符号AppCompatActivity。



app模块的build.gradle包含:



依赖项{

编译fileTree(dir:'libs',包括:['* .jar'])

编译'com.android .support:appcompat-v7:22.2.1'

}



此外,该库存在于< sdk> / extras / android中/支持版本22.2.1。



但我很想知道它为什么找不到它。



也许有人知道更多?



问候

Sascha

Hello Codeprojecters,

today i've started to learn to program in Java for Android.

I have used Android-Studio to generate the initial code. But if i'm opening my MainActivity.java i have seen that it uses a "import android.support.v7.app.AppCompatActivity;" for including AppCompatActivity as dependency. The IDE tells me that it can't resolve the symbol "AppCompatActivity".

The build.gradle for the app module contains:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}

Also the Library is present inside <sdk>/extras/android/support with version 22.2.1.

But i'm wonder why it doesn't find it.

Maybe anyone knows more?

Greetings
Sascha

推荐答案

您很可能已将应用程序级别设置为高于使用Android Studio安装的库。不幸的是,Android开发似乎移动得非常快,因此您需要确保拥有最新的库,并为您可以支持的版本设置目标级别。您可以在 http://developer.android.com/tools/studio/index.html [ ^ ],以及Peter Leow撰写的文章: 设置Android开发环境 [ ^ ]。
Most likely you have set the application level higher than the libraries you have installed with Android Studio. Unfortunately, Android development seems to move quite fast so you need to ensure you have the latest libraries, and that you set your target level for the version you can support. You can get more information at http://developer.android.com/tools/studio/index.html[^], and from Peter Leow's article: Setting Up Your Android Development Environment[^].


这篇关于我可以修复Android.Support.V7.App.Appcompatactivity的破坏依赖性;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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