2017-02-17 16 views
2

Я полностью в тупике с этим. Я запускаю Android Studio 2.2.2, и вчера все было в порядке. Приложение выполнило и запущено на устройстве без каких-либо проблем. Сегодня я получаю это ...Android API 25 CardView Неподдерживаемый тип

enter image description here

Глядя на снимок экрана вы можете увидеть выделенную область, которая гласит «Error:. Неподдерживаемый тип„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 с другими макетами для обычного, 600dp и т. Д. Я проверяю это позже и проверяю путь. –

+0

Еще раз спасибо. Я дважды проверил каталог файлов, изменив дерево каталогов, чтобы показать «Пакеты», и нашел два дополнительных файла, одним из которых был фрагмент. Удалил его и побежал чистым, и он подчинился и побежал. –