1

I looked up similar posts but as I am not using com.google.gms I'm a bit at lost where else to look, also I updated all implementation (formerly compile) references.

Here the warnings I receive on my app/build.gradle

WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variantOutput.getPackageApplication(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information. Affected Modules: app

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Affected Modules: app

WARNING: Configuration 'debugCompile' is obsolete and has been replaced with 'debugImplementation' and 'debugApi'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Affected Modules: app

// changed from gradle 2.3.3 to gradle 3.4.1 syntax as per 
// google developer sites and gradle blogs

// app/build.gradle:

#import java.text.DateFormat
#import java.text.SimpleDateFormat

// migrate from Android Studio with gradle:2.3.3 
// to Android Studio with gradle:3.4.1
// jm*20190531

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

apply plugin: 'com.android.application'
apply plugin: 'hugo'
apply plugin: 'maven'


/*  **

    some methods to build app names with date, git-commit, version numbers
    here omitted

**  */

android {
    compileSdkVersion 28   // jm*20190405
    buildToolsVersion "28.0.3"   // "25.0.3"

    defaultConfig {
        minSdkVersion 16           /*** was: 9, then: 14 ***/
        targetSdkVersion 28        /*** was: 21, then: 25 ***/
        buildConfigField "String", "BUILD_DATE", "\"" + todayIso8601() + "\""
        buildConfigField "String", "SHORT_COMMIT_HASH", "\"" + getShortCommitHash() + "\""
    }

    signingConfigs {
        create("myConfig") {
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeType "jks"
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        //    signingConfig = signingConfigs.wxConfig
        }
    }

    flavorDimensions 'vox'    // jm*20190512

    productFlavors {
        voxDigits {
            applicationId "net.wavvox.VoxDigits13"
            versionCode versionCodeVoxDigits()
            versionName versionNameVoxDigits()
            dimension 'vox'
        }
        voxChat {
            applicationId "net.wavvox.voxchat"
            versionCode versionCodeVoxChat()
            versionName versionNameVoxChat()
            dimension 'vox'
        }

        // Rename APK for the appropriate productFlavor
        applicationVariants.all { variant ->
            //variant.outputs.every { output ->
            variant.outputs.all { output ->
                String flavorName = variant.productFlavors[0].name
                System.out.println("***** flavorName: " + flavorName)
                def relativeRootDir = output.packageApplication.outputDirectory.toPath()
                                            .relativize(rootDir.toPath()).toFile()
                def relativeRootDir0 = "../../.."

                switch (flavorName) {   // jm*20190405
                    case "voxChat":
                        //output.outputFile = new File(output.outputFile.parent,
                        //        output.outputFile.name.replace("app-voxChat", apkNameVoxChat)) );
                        output.outputFileName = new File("$relativeRootDir"+"/"+"app",
                                output.outputFileName.replace("app-voxChat", apkNameVoxChat()) )
                        break
                    case "voxDigits":
                        //output.outputFile = new File(output.outputFile.parent,
                        //        output.outputFile.name.replace("app-voxDigits", apkNameVoxDigits()) );
                        output.outputFileName = new File( "$relativeRootDir"+"/"+"app",
                                output.outputFileName.replace("app-voxDigits", apkNameVoxDigits()) )
                        break
                    default:
                        System.out.println("!!!!! unknown flavorName: " + flavorName + " !!!!!")
                        // old method, gradle:2.3.3
                        //output.outputFile = new File(output.outputFile.parent,
                        //        output.outputFile.name.replace(".apk","-${finalVersion}.apk"))
                        // new method, gradle:3.4.1
                        //outputFileName = new File(output.outputFile.parent,
                        //        outputFileName.replace(".apk", "-${finalVersionCode}.apk"))
                        break
                }   // switch

                System.out.println("relativeRootDir: " + relativeRootDir)
                System.out.println("output.outputFileName: " + output.outputFileName)
            }
        }
    } // End productFlavors block

}


dependencies {
    /* WavvoxLibrary AAR module */
    implementation project(':wavvoxlibrary')

    /* Google Android support libraries */
    implementation 'com.android.support:support-annotations:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'

    /* Dagger 2 */
    implementation 'com.google.dagger:dagger:2.22.1'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.22.1'
    compileOnly 'javax.annotation:jsr250-api:1.0'

    /* Progress Circle */
    implementation 'com.github.jakob-grabner:Circle-Progress-View:v1.3'
}


/*  **

    not quite sure about Dagger and Progress Circle;
    got inherited from some older projects 

**  */

I want to get a handle of those warnings and learn how to debug and find the source of the problem; the warnings are not descriptive....

Thanks, jm.

jürgen m
  • 11
  • 6
  • BTW, I managed to update my project from Android Studio & gradle 2.3.3 to 3.4.1; and my library was even updated from gradle-experimental 0.9.3; see https://github.com/jmhoraze/migrate_wavvoxlibrary_in_AndroidStudio – jürgen m Jul 01 '19 at 23:07
  • Possible duplicate of ["Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'."Warning keeps coming up again and again](https://stackoverflow.com/questions/52252487/configuration-compile-is-obsolete-and-has-been-replaced-with-implementation) – Wale Jul 01 '19 at 23:46
  • you can check here: https://stackoverflow.com/questions/52252487/configuration-compile-is-obsolete-and-has-been-replaced-with-implementation/52252677 take note of Hugo plugin. – Wale Jul 01 '19 at 23:46
  • thank you, and I read about the "hugo"; problem is, that, by removing classpatch and apply plugin I now get error: "ERROR: No value has been specified for property 'manifestOutputDirectory'." instead of the previous two of the three warnings. and still the warning about the variantOutput: "WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'. (...) Affected Modules: app " and that one (as click on "app" does not go to the causing line) may be also coming from one of the extra tool specified...? – jürgen m Jul 02 '19 at 01:01
  • the answers / comments re "classPath" are not addressing the problem as the warnings occur during build by gradle! the "implementation" section will need to be review as here (external) projects are compiled that have a build.gradle of their own; and if those projects had not beed updated, then gradle will issue the warnings! in my case (at least re the "compile" vs. "implementation" warning) the "circle-progress-view" project by Jacob Grabner is the culprit. and no, there are NOT a duplicate to StackOverflow questions listed in comments earlier, and NOT related to "Hugo" plugin! Thanks. – jürgen m Jul 05 '19 at 03:06

1 Answers1

0

The problem is that some of the libraries you use may be using compile instead of implementation, checking the libraries you use that are not many at the moment.

I see that the library com.github.jakob-grabner: Circle-Progress-View: v1.3 uses compile to add the dependency com.android.support:support-annotations:25.1.0, in the following link you can see that they are using compile instead of api, implementation, etc. (gradle version 1.3).

Reviewing the repository of the library I see that there is a newer version and it is 1.4 (gradle version 1.4) this version if it is updated and add the dependency using the keyword api,

I recommend you update the library to avoid that warning.

Juanes30
  • 2,398
  • 2
  • 24
  • 38
  • thank you; that version is using a minsdkversion that is higher than I'm using in my project; hence this error during build: "FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processVoxDigitsReleaseManifest'. > Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.github.jakob-grabner:Circle-Progress-View:1.4] (...) or use tools:overrideLibrary="at.grabner.circleprogress" to force usage (may lead to runtime failures)" Perhaps may try to follow the last suggestion to force usage... – jürgen m Jul 02 '19 at 01:24
  • you could fork the library and modify the `minSdk` and see if it compiles, in case you compile the add to your project or do a pull request – Juanes30 Jul 02 '19 at 02:43
  • Is it necessary for your app to be compatible with sdk 11? I say it because currently the phone share in that version is very small, in the following link have more information. https://developer.android.com/about/dashboards – Juanes30 Jul 02 '19 at 03:17
  • I'm using minSDK 16 (not 11), so that my Apps run on my elder Samsung Galaxy S2 with Android 4.1.2. as to "Circle Progress": v.1.3 had a lower minSDK version, and for v.1.4 (as far I can see) only the new gradle syntax was done... – jürgen m Jul 03 '19 at 07:25