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'에 다른 레이아웃 (보통, 600dp 등)이 있습니다. 나중에 확인하고 경로를 확인합니다. –

+0

다시 한번 감사드립니다. 나는 'Packages'를 보여주기 위해 디렉토리 트리를 변경하여 파일 디렉토리를 두 ​​번 확인했으며, 두 개의 파일을 추가로 찾았습니다. 그 중 하나는 fragment_new.xml이었습니다. 그것을 제거하고 깨끗이 달려와 준수하고 달렸다. –

관련 문제