2016-07-16 7 views
-2

나는 Android Studio을 사용하여 조금 Hello World 프로그램을 작성했습니다. 최소 sdk API는 16입니다. API 21에서 실행되는 가상 장치를 설치했는데 프로그램이 정상적으로 작동합니다. 나는 또한 잘 작동하는 안드로이드 6 휴대 전화로 갤럭시 S5에서 프로그램을 실행하려했습니다.Android Studio for Jelly Bean 설정

그런 다음 휴대 전화 (Galaxy S2와 Jelly Bean)를 연결하고 전화로 실행하려고했습니다. 그러나 그것은 단지 응용 프로그램을 닫고 프로그램을 닫았습니다. 응용 프로그램 build.gradle 파일 : 전체 프로젝트 디렉토리 내가 주시면 감사하겠습니다 잘못이었다에 here .ANY 도움말을 찾을 수 있습니다

apply plugin: 'com.android.application' 

    android { 
     compileSdkVersion 24 
     buildToolsVersion "21.1.2" 
     defaultConfig { 
     applicationId "magu.schwaderina" 
     minSdkVersion 16 
     targetSdkVersion 24 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     vectorDrawables.useSupportLibrary = true 
     } 
     buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
     } 
    } 

    dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     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:24.0.0' 
     compile 'com.android.support:support-v4:24.0.0' 
     compile 'com.android.support:support-vector-drawable:24.0.0' 
     testCompile 'junit:junit:4.12' 
    } 

Here is the log shown by Android Studio

는 그리고이 모듈입니다.

편집 : 난 당신이 v1.5.0를 사용하거나 Gradle을 플러그인의 아래 앱의 빌드에 다음 코드가 필요하면 내가 우분투 14.4

+0

이미 모든 api 버전에 Android 스튜디오가 설정되어 있습니다. ** Jelly Bean 용 Android Studio 설정 **과 같은 것은 없습니다. ** !! –

+0

안드로이드 스튜디오 –

+0

@APPBird에서 오류 로그를 게시 할 수 있습니까? 오류 로그는 전체 프로젝트뿐만 아니라 링크되어 있으므로 너무 길기 때문에 오류 로그를 직접 질문에 붙여 넣을 수 없습니다. –

답변

1

에 안드로이드 스튜디오 2.2 이전 5를 사용하고 언급하는 것을 잊었다. Gradle을 :

android { 
    defaultConfig { 
    // Stops the Gradle plugin’s automatic rasterization of vectors 
    generatedDensities = [] 
    } 
    // Flag to tell aapt to keep the attribute ids around 
    aaptOptions { 
    additionalParameters "--no-version-vectors" 
    } 
} 

https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88#.njl8u0f91

+0

답변 해 주셔서 감사합니다. 나는 Gradle 버전 2.1을 사용하고 있으며, 자동으로'vectorDrawables.useSupportLibrary = true'라는 줄을 추가했습니다. 이것은 매우 좋은 방법입니다. –

0

모든 정보가 로그에서 사용할 수는 밀접하게 그것을 검토하고 (벡터 그리기와 관련된) 문제를 발견 할 것입니다하시기 바랍니다. 모든 정보가 로그에서 호출됩니다 (줄 번호 등 포함). 따라서 문제를 설명하는 오류를 따르십시오.

로그 맨 아래부터 시작하여 위로 이동하십시오.

java.lang.RuntimeException: Unable to start activity ComponentInfo{magu.schwaderina/magu.schwaderina.Main}: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020013 
다음

당신은 스택까지 더 이동하는 경우, 당신이 포함 알아 둘 찾아 볼 수 있습니다 :

E/VdcInflateDelegate: Exception while inflating <vector> 
        org.xmlpull.v1.XmlPullParserException: Binary XML file line #17<vector> tag requires viewportWidth > 0 
         at 
을 당신은이 메시지를 기반 포함하는 벡터 드로어 블 Drawable에 문제를 가지고 있다고 볼 수 있습니다
+0

정보가있는 동안 나는 여전히 그것에 대해 행동 할 수 없습니다. 그것에 대해 조금 더 자세히 설명해 주시겠습니까? –