2017-02-17 7 views
2

私はこのカードで完全に困惑しています。私はAndroid Studio 2.2.2を実行していますが、昨日はすべてうまくいきました。アプリはこれまでどおり何も問題なくデバイスに準拠して起動しました。今日、私はあなたが「エラーを述べてハイライト領域を参照することができ、スクリーンショットを見てAndroid API 25 CardViewサポートされていないタイプ

enter image description here

...これを取得する:サポートされていないタイプ 『をandorid.support.v7.widget.CardView』

は、ここに私のGradle

buildscript { 
repositories { 
    maven { url 'https://maven.fabric.io/public' } 

} 

dependencies { 
    classpath 'io.fabric.tools:gradle:1.+' 
} 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 


repositories { 
maven { url 'https://maven.fabric.io/public' } 
maven { url "https://jitpack.io" } 
mavenCentral() 
} 



android { 
compileSdkVersion 25 
buildToolsVersion '25.0.0' 

defaultConfig { 
    applicationId "com.rdvejuicecalculator.and" 
    minSdkVersion 14 
    targetSdkVersion 25 
    versionCode 88 
    versionName "6.3.7" 

    applicationVariants.all { variant -> 
     variant.outputs.each { output -> 
      def file = output.outputFile 
      def fileName = file.name.replace(".apk", "-v" + versionName + "-  
    c" + versionCode + ".apk") 
      output.outputFile = new File(file.parentFile, fileName) 
     } 
    } 
} 
buildTypes { 
    debug { 
     applicationIdSuffix ".debug" 
     versionNameSuffix "-DEBUG" 
     //ext.enableCrashlytics = false 
     try { 
      signingConfig signingConfigs.debug 
     } catch (ex) { 
     } 
     minifyEnabled false 
    } 
    release { 
     try { 
      signingConfig signingConfigs.release 
     } catch (ex) { 
     } 
     zipAlignEnabled true 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro' 
    } 
} 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:cardview-v7:25.1.1' 
compile 'com.android.support:recyclerview-v7:25.1.1' 
compile 'com.github.AndroidDeveloperLB:MaterialPreferenceLibrary:9' 
compile 'com.afollestad.material-dialogs:core:0.9.0.1' 
compile 'io.github.kobakei:ratethisapp:1.0.5' 
compile 'com.github.paolorotolo:appintro:4.0.0' 
compile 'com.android.support:appcompat-v7:25.1.1' 
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
    transitive = true; 
} 
compile 'com.android.support:support-v4:25.1.1' 
compile 'com.android.support:design:25.1.1' 
compile('com.crashlytics.sdk.android:answers:[email protected]') { 
    transitive = true; 
} 
compile 'com.github.paolorotolo:expandableheightlistview:1.0.0' 
compile 'com.google.android.gms:play-services-drive:10.2.0' 
compile 'com.google.android.gms:play-services-auth:10.2.0' 
compile files('libs/opencsv-3.8.jar') 
compile 'de.psdev.licensesdialog:licensesdialog:1.8.1' 
compile 'com.android.support:multidex:1.0.1' 
} 

されており、ここで参照レイアウトXML

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical"> 

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:card_view="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/card_view" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_margin="10dp" 
    card_view:cardCornerRadius="4dp"> 


    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 


     <RelativeLayout 
      android:id="@+id/relativeLayout1" 
      style="?pageBackground" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="top" 
      android:isScrollContainer="true" 
      android:paddingLeft="5dp" 
      android:paddingRight="5dp" 
      android:paddingTop="10dp"> 


    .... Some text views and edit text views .... 


     </RelativeLayout> 
    </ScrollView> 
</android.support.v7.widget.CardView> 
にあります

私がこれまで行ってきたことは、プロジェクトをクリーンアップし、プロジェクトをビルドし、Android Studioを再インストールしました。アンインストールされ、API 25と24から14を再インストールしました。でも、このエラーが発生し、アプリが実行されません。誰にも試してみるアイデアはありますか?

答えて

2

レイアウトのファイルは、layoutディレクトリ内にある必要があります。次のようなものがあります。 `res/layout/large/fragment_new.xml

+0

ありがとうございます。エラーがパスを正しく表示していないことを私は知らなかった。ファイルは 'res/layout/fragment_new'にあり、その他のレイアウトはnormal、600dpなどです。これを後でチェックし、パスを確認します。 –

+0

もう一度ありがとうございます。私は、ディレクトリツリーを 'Packages'を表示するように変更してファイルディレクトリをダブルチェックし、2つのファイルが余っていることを発見しました。その1つはfragment_new.xmlでした。それを取り除き、きれいに走り、遵守して走った。 –

関連する問題