2

I have a problem in the Gradle files. As I have updated the Android Studio I had to update the dependencies as well, but I'm getting unresolved dependencies.

Project gradle:

buildscript {
repositories {
    mavenCentral()

    maven { url 'https://maven.fabric.io/public' }       
    google()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.4.1'
    classpath 'io.fabric.tools:gradle:1.29.0'
    classpath 'com.novoda:bintray-release:0.4.1'
    classpath 'com.google.gms:google-services:4.1.0'


}

}

allprojects {
repositories {

    maven { url 'https://maven.fabric.io/public' }

    jcenter()
}
}

app gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'


android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
useLibrary  'org.apache.http.legacy'

defaultConfig {
    applicationId "com.packagename"
    minSdkVersion 21
    targetSdkVersion 28
    multiDexEnabled true
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
    }
}

lintOptions {
    disable "ResourceType"
}
}

ext {
    googlePlayServicesVersion = "4.2.0"
}


dependencies {
implementation files('libs/icu4j-4_4_2_2.jar')
implementation files('libs/jsoup-1.6.3.jar')
implementation files('libs/ksoap2-android-assembly-2.6.0-jar-with-dependencies.jar')
implementation files('libs/zip4j_1.2.6.jar')

implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
    transitive = true;
}

implementation 'com.facebook.android:facebook-android-sdk:4.38.1'
// Google
implementation 'com.google.android.gms:play-services-auth:16.0.1'

implementation'com.google.firebase:firebase-auth:16.1.0'

// Firebase
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.3'


implementation 'com.google.android.gms:play-services-ads:17.2.1'

implementation project(':pdflibrary')
implementation 'com.android.support:support-compat:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:customtabs:27.0.2'

implementation files('libs/junit-4.3.jar')

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'

implementation 'com.google.android.gms:play-services-flags:16.0.1'
implementation 'com.google.android.gms:play-services-basement:16.0.1'

implementation fileTree(dir: 'libs', include: ['*.jar'])
}

pdfLibrary gradle:

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'



defaultConfig {
    minSdkVersion 24
    targetSdkVersion 28
    versionCode 1
    versionName '1'
}

sourceSets {
    main {
        jniLibs.srcDirs = ['libs']
    }
}
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
}

publish {
    userOrg = 'thefinestartist'
    groupId = 'com.thefinestartist'
    artifactId = 'finestwebview'
    publishVersion = '1'
    desc = 'Beautiful and customizable Android Activity that shows web pages within an app.'
    website = 'https://github.com/TheFinestArtist/FinestWebView-Android'
}

This is the errors I'm getting knowing that min-sdk is set to 24 and I only in the gradle and I have removed it from both manifests (app & pdfLibrary):

enter image description here

I have tried suggestion from other SO questions, but nothing worked.

halfer
  • 19,824
  • 17
  • 99
  • 186
coder
  • 5,200
  • 3
  • 20
  • 45

2 Answers2

1

edit minSdkVersion to 21 instead of 24 in pdfLibrary gradle

an sync project

Mohammad Sommakia
  • 1,773
  • 3
  • 15
  • 48
  • 1
    put it in the all project script allprojects { repositories { google() maven { url 'https://maven.fabric.io/public' } jcenter() } } – Mohammad Sommakia Jun 11 '19 at 12:50
  • I updated the question with the error, do you think you can help me with it? – coder Jun 11 '19 at 12:55
  • 1
    try to remove apply plugin: 'com.google.gms.google-services' from app gradle – Mohammad Sommakia Jun 11 '19 at 12:56
  • 2
    @coder You shouldn't change the question in this way. You posted a question and you have some answers. Changing the question, these answers are useless and illegible. Pls post another question instead of change the previous one. – Gabriele Mariotti Jun 11 '19 at 12:58
  • I will edit the question to add old mistakes and what had been modified so everyone can benefit, thank you for your contribution – coder Jun 11 '19 at 12:59
  • @Mohammad Sommakia Thank you I have a different error now, but I will try to make some research before asking. Thank you – coder Jun 11 '19 at 13:00
  • @MohammadSommakia I have posted a new question here: https://stackoverflow.com/questions/56574910/duplicate-class-in-classes-jar-on-build-project-after-update-of-android-studio, If you could check and give me suggestions I would appreciate it. – coder Jun 13 '19 at 07:12
1

In the allprojects block you have to add the google() maven repo.

allprojects {
  repositories {
    google()  
    maven { url 'https://maven.fabric.io/public' }
    jcenter()
  }
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841