2017-02-04 1 views
1

에 overrideLibrary 나는 minSdk="14"와 주요 애플 리케이션을 가지고 있고, 페이스 북 SDK 안드로이드 V 4.16.1는 minSdk="15"이해 도구 ​​: 안드로이드

build.gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.dmitriev_m.sample_android" 
     minSdkVersion 14 
     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(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.facebook.android:facebook-android-sdk:4.16.1' 
    compile 'com.android.support:appcompat-v7:25.1.0' 
} 

의 AndroidManifest.xml을 가지고. 여기

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    package="com.example.dmitriev_m.sample_android"> 

    <uses-sdk 
     android:minSdkVersion="14" 
     android:targetSdkVersion="25" 
     tools:overrideLibrary="com.facebook, android.support.customtabs" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 
     <activity android:name=".MainActivity"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 

은 무엇,439,275입니다 오류가 발생, 주요 매니페스트 파일보다 높은입니다의 minSdkVersion 값과 을 가져올 수 없습니다 라이브러리와 라이브러리를 가져올 때, 기본적으로

:3210 AndroidManifest.xml 파일을 병합에 대해 말한다. 합병 도구가이 충돌을 무시하고 앱의 더 낮은 minSdkVersion 값을 유지하면서 라이브러리를 가져 오려면 태그에 overrideLibrary 속성을 추가하십시오. 값은 하나 이상의 라이브러리 패키지 이름 (쉼표로 구분) 을 나타내며 을 나타내며 기본 매니페스트의 minSdkVersion을 재정의 할 수있는 라이브러리를 나타냅니다.

하지만 내 병합 된 매니페스트 (최소 SDK는 14입니다) 응용 프로그램처럼 페이스 북 SDK의 오버라이드 매니페스트 파일을 찾습니다 : 그것은이 응용 프로그램을 실행하는 것이 안전

Merged Manifest, min SDK = 14

인가? 내 말은 페이스 북 SDK가 Android API 15에서 메서드를 호출하면 응용 프로그램이 중단되어야한다는 의미입니다.

답변

1

YE는 라이브러리가 API 15 함수를 호출하고 장치가 API 14 만 사용하는 경우 충돌합니다. 장치가 API15 이상이면 여전히 작동합니다.

나는이 경우에도 걱정하지 않을 것이다. 14 명은 Anroid 3.x였다. 3.x 장치가 아주 적었습니다. Android 태블릿은 4.0이 출시 될 때까지 이륙하지 않았습니다. 사용중인 3.x 모델의 비율은 모든 장치의 0.1 % 미만입니다. 그들이 작동하지 않는다면, 그들을 지원하는 시간과 노력이 정말로 가치가 있습니까? 솔직히 나는 15 분 이상으로 minsdk를 올릴 것입니다. (19 %로 끌어 올리면 아시아, 아프리카 및 남미 지역의 저소득 국가에 비중이 큰 전세계 시장의 10 % 만 제거됩니다. 주요 목표가 미국과 EU 인 경우 지원 비용 그).

+0

14는 Android 3.x가 아닙니다. Android 4.0입니다. https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels –

+1

맞습니다. 하지만 여전히 모든 기기의 .1 % 미만 https://developer.android.com/about/dashboards/index.html –