vectorDrawables.useSupportLibrary = true을 gradle로 설정 한 다음 앱을 실행하면 안타깝게도 중지되었습니다. vectorDrawables.useSupportLibrary = true 앱을 삭제하면 앱이 작동합니다.Android vectorDrawables.useSupportLibrary = true 앱을 중지합니다.
내 Gradle을 :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "com.helikanon.firstapp"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.android.support:support-v4:25.1.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.google.android.gms:play-services-ads:10.0.1'
}
오류 :
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.helikanon.firstapp/com.helikanon.firstapp.activities.MainActivity}: android.view.InflateException: Binary XML file line #62: Error inflating class Button
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #62: Error inflating class Button
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
.
.
.
내가 API 광고 (16) 및 API (19)를 사용하지만 API 광고 (23)를 사용하면 작동 할 때 응용 프로그램이 충돌한다.
이 기사 - http://chris.banes.me/2016/02/25/appcompat-vector/를보십시오. 나도이 문제가 있었다. –
나는이 기사에서 정확히했으나 여전히 오류가 발생했습니다. – Alexander
나는 추락의 이유를 알고 싶다고 생각했습니다. 어쨌든, 사용중인 gradle 버전은 무엇입니까? –