【发布时间】:2015-05-24 11:58:30
【问题描述】:
导入时出现无法解决的错误 android.support.v7.app.Fragment。
我尝试了不同线程中给出的所有解决方案。 我是不是遗漏了什么,请帮忙。
- 我已经下载了安卓支持库。
minSdkVersion 14 targetSdkVersion 14-
添加依赖库
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.android.support:support-v4:22.1.1' } 同步build.gradle文件(右键文件-->同步 'build.gradle') 并清理你的项目(构建 --> 清理项目) 更改后。
我仍然无法重新喜欢这个。请帮忙
build.gradle(模块:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.android.effectivenavigation"
minSdkVersion 14
targetSdkVersion 14
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v4:22.1.1'
}
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.effectivenavigation"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="14" />
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
<activity android:name=".MainActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".CollectionDemoActivity" android:label="@string/demo_collection" />
</application>
</manifest>
【问题讨论】:
-
你的电脑上是否安装了22.1.1版本,查看SDK管理器?
-
是的sdk有android支持库22.1.1版本。