Я получаю, что пошло не так: выполнение задачи не выполнено: app: generateDebugBuildConfig.> \ AndroidManifest.xml - PullRequest
0 голосов
/ 15 октября 2018

Я получаю следующее Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [me.riddhimanadib.bottom-nav-bar:bottom-nav-bar:1.0.0] C:\Users\admin\.gradle\caches\transforms-1\files-1.1\bottom-nav-bar-1.0.0.aar\6ccf719b3589ca01ca26fd0f5b0fe6cc\AndroidManifest.xml as the library might be using APIs not available in 15
    Suggestion: use a compatible library with a minSdk of at most 15,
        or increase this project's minSdk version to at least 16,
        or use tools:overrideLibrary="me.riddhimanadib.library" to force usage (may lead to runtime failures)

Ниже мой app.gradle:

apply plugin: 'com.android.application'
 android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "yodgobekkomilov.edgar.com.worldnews"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
    implementation 'io.reactivex:rxjava-math:1.0.0'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
// RxAndroid
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    implementation 'com.squareup.retrofit2:retrofit:2.0.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
    implementation "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0"
    implementation "com.squareup.okhttp3:okhttp:3.0.1"
    implementation "com.squareup.okhttp3:okhttp-urlconnection:3.0.1"
    implementation "com.squareup.okhttp3:logging-interceptor:3.4.1"
    implementation 'com.android.support:cardview-v7:28.0.0-alpha3'
    implementation 'com.android.support:recyclerview-v7:28.0.0-alpha3'
    implementation 'com.android.support:design:28.0.0'
    implementation 'me.riddhimanadib.bottom-nav-bar:bottom-nav-bar:1.0.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

}

Ответы [ 3 ]

0 голосов
/ 15 октября 2018

Измените minSdkVersion на 16, и ваша проблема будет решена.

 defaultConfig {
        applicationId "yodgobekkomilov.edgar.com.worldnews"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
0 голосов
/ 15 октября 2018

использует-sdk: minSdkVersion 15 не может быть меньше, чем версия 16, объявленная в библиотеке

Так как вы должны изменить minSdkVersion на 16:

defaultConfig {
        applicationId "yodgobekkomilov.edgar.com.worldnews"
        minSdkVersion 16
        ...
        ..

Никто не упомянул о разных версиях библиотек поддержки, поэтому я добавляю ответ для правильных зависимостей.В build.gradle используйте ту же версию для следующих зависимостей:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0' 

    ...
    ..
0 голосов
/ 15 октября 2018

Если вы хотите поддерживать SDK версии 15 и также хотите использовать эту библиотеку, сделайте это

Внутри вашего AndroidManifest.xml файла добавьте

<uses-sdk tools:overrideLibrary="me.riddhimanadib.library" /> <!--you need to add this-->

ваш манифест будет выглядеть так -

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

    <uses-sdk tools:overrideLibrary="me.riddhimanadib.library" /> <!--you need to add this-->
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:name=".YOUR_APPLICATION"
        android:icon="@mipmap/ic_launcher">

        <activity android:name=".activity"></activity>
    </application>

</manifest>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...