2015-08-27 159 views
2

我整合了新的設計庫,並沒有找到一個解決辦法然而,當下列崩潰:android.support.design.CoordinatorLayout類未找到

錯誤充氣類android.support.design.CoordinatorLayout

這裏是我的gradle這個文件:

android { 
compileSdkVersion 23 
buildToolsVersion "23.0.0" 

defaultConfig { 
    applicationId "xxxxxxxx" 
    minSdkVersion 14 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile project(':volley') 
    compile 'com.android.support:design:23.0.0' 
    compile 'com.android.support:appcompat-v7:23.0.0' 
    compile 'com.android.support:support-v4:23.0.0' 
    compile 'com.android.support:recyclerview-v7:23.0.0' 
    compile 'com.android.support:cardview-v7:23.0.0' 
} 

...和應用風格:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
    <!-- Customize your theme here. --> 

    <item name="android:colorPrimary">@color/primary</item> 
    <item name="android:colorPrimaryDark">@color/primary_dark</item> 
    <item name="android:colorAccent">@color/accent</item> 
    <item name="android:colorBackground">@android:color/white</item> 
    <item name="android:windowBackground">@android:color/white</item> 

    <item name="android:colorControlNormal">#cccccc</item> 
</style> 

public class TabbedScreenActivity extends AppCompatActivity

回答

4

它在android.support.design.widget包中。膨脹android.support.design.widget.CoordinatorLayout

+0

完美,感謝 –

+0

哇,出渣後在'dependencies'中有不同版本的支持庫,這是真正的問題..在我的佈局中,我用''替換了'',現在它運行。 – trooper

0

以上回答是正確的也是保證你有符合buildtoolsversion

compile 'com.android.support:appcompat-v7:25.2.0' 
compile 'com.android.support:design:25.2.0' 

我這樣做,它的工作對我的依賴..