2015-05-24 25 views
0

導入時出現無法解析錯誤012. android.support.v7.app.Fragment導入 。導入android.support.v7.app無法解析

我嘗試了所有在不同線程中給出的解決方案。 我錯過了什麼請幫忙。

  1. 我已經下載了android支持庫。
  2. minSdkVersion 14 targetSdkVersion 14
  3. 的依賴增加庫

    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' 
    } 
    
  4. 同步的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> 
+0

你有你的電腦上安裝22.1.1版本,請檢查SDK管理器? –

+0

是sdk有android支持庫22.1.1版本。 – user2115364

回答

0

對不起,我不能發表評論。 嘗試使用

compile 'com.android.support:support-v4:21.0.+' 

降低版本修復了我。

+0

還是一樣的......不幸運:( – user2115364

-1

您的項目右擊,選擇打開模塊設置,然後在模塊設置窗口中,單擊模塊/應用。然後在窗口的右側選擇依賴項 TAB。然後按PLUS標誌並選擇'庫依賴'。 在新的顯示窗口中,選擇您的支持庫,然後單擊確定

+0

我只通過此路徑添加了庫依賴項 – user2115364