Search result for Question Taged gradlew
There are some results of your Tag: gradlew
    how to solve Could not find or load main class org.gradle.wrapper.GradleWrapperMain

    1. FAILURE
    2. execution of the command ./gradlew leads to the following output:
      usr$ ./gradlew tasks
      Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
      

    3. What is gradle wrapper
    4. gradlew is the gradle wrapper executable - batch script on windows and shell script elsewhere. The wrapper script when invoked, downloads the defined gradle version and executes it. By distributing the wrapper with your project, anyone can work with it without needing to install Gradle beforehand. Even better, users of the build are guaranteed to use the version of Gradle that the build was designed to work with.

    5. Restoring gradle wrapper
    6. It used to be that you needed to add a wrapper task to your build.gradle to restore gradle wrapper and all its dependencies. For instance:

      task wrapper(type: Wrapper) {
          gradleVersion = '4.1'
      }
      

      Newer versions of gradle do not require this. It is now a built-in task. Just run:

      gradle wrapper
      

      You can also supply additional flags to specify versions etc

      gradle wrapper --gradle-version 6.2 --distribution-type all
      

      When you run this task, a gradle wrapper script, and the required jar files are added to your source folders. Properties are stored in gradle/wrapper/gradle-wrapper.properties

      (You may need to install gradle locally to run this. brew install gradle on mac for instance. See more detailed instructions here)

    7. Why was it missing in the first place?
    8. OP seems to have deleted something that gradle wrapper depends on.

      But a common reason is that a .gitignore entry prevents wrapper jars from being checked into git. Note that the .gitignore in effect may be in the source folder, or a global one in your user home folder or git global configuration. It is common to have a *.jar entry in .gitignore.

      You can add an exception for gradlew's jar files in .gitignore

      *.jar
      !gradle/wrapper/gradle-wrapper.jar
      

      or force add the wrapper jar into git

      git add -f gradle/wrapper/gradle-wrapper.jar
      

      --
      Ref: Gradle Wrapper

    9. Other Solution
    10. What worked for me is to first run:

       gradle wrapper
      

      After successful build I was able to run

      ./gradlew assembleRelease
      

      Note: To be able run gradle wrapper first run brew install gradle. If installation successful run gradle wrapper from project root.

      Source and thanks: http://gradle.org/docs/current/userguide/gradle_wrapper.html and https://stackoverflow.com/users/745574/rage

      In my case it was a global .gitignore, as explained in @HankCa's answer.

      Instead of forcefully adding the jar, which you'll need to remember to do in each Gradle project, I added an override to re-include the wrapper jar in my global .gitignore:

      *.jar
      !gradle/wrapper/gradle-wrapper.jar
      

      This is useful to me as I have many projects that use Gradle; Git will now remind me to include the wrapper jar.

      This override will work so long as no directories above gradle-wrapper.jar (such as gradle and wrapper) are ignored -- git will not descend in to ignored directories for performance reasons.

    Laxmi Queenie 2022-08-11
    Android- Error:Execution failed for task ':app:transformClassesWithDexForRelease'

    The Problem is that i am able to run my app when i change to debug mode but it fails when i switch to release mode.

    Exception:

    **FAILURE: Build failed with an exception.**
    > Execution failed for task ':app:transformClassesWithDexForRelease'.
    > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
    

    When i ran the gradle build command with stacktrace then this is what i get

    ./gradlew app:transformClassesWithDexForRelease --stacktrace
    
    > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
    
    *Exception is:*
    
    >org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexForRelease'.
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
                at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
                at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
                at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
                at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
                at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
                at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
                at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
                at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
                at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
                at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
                at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
                at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
                at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
                at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
                at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
                at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
                at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
                at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
                at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
                at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
                at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
                at org.gradle.internal.Factories$1.create(Factories.java:22)
                at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
                at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
                at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
                at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
                at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
                at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
                at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
                at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
                at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
                at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
                at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
                at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
                at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
                at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
                at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
                at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
                at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
                at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
                at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
                at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
                at org.gradle.util.Swapper.swap(Swapper.java:38)
                at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
                at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
                at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
                at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
                at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
                at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
                at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
                at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
        Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
                at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:54)
                at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:57)
                at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
                at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
                at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
                at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
                at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
                at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
                at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
                ... 68 more
        Caused by: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
                at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:422)
                at com.android.build.gradle.internal.pipeline.TransformTask$3.call(TransformTask.java:178)
                at com.android.build.gradle.internal.pipeline.TransformTask$3.call(TransformTask.java:174)
                at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
                ... 77 more
        Caused by: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
                at com.android.builder.core.AndroidBuilder.runDexer(AndroidBuilder.java:1472)
                at com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1389)
                at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:250)
                ... 80 more
        Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
                at com.android.builder.core.AndroidBuilder.runDexer(AndroidBuilder.java:1456)
                ... 82 more
        Caused by: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
                at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:43)
                at com.android.builder.core.AndroidBuilder$2.call(AndroidBuilder.java:1464)
                at com.android.builder.core.AndroidBuilder$2.call(AndroidBuilder.java:1456)
        Caused by: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
                at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:367)
                at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:41)
                ... 2 more
    

    I am using

    • Android Studio 2.0 Beta 6
    • Java version: Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
    • Gradle Version: com.android.tools.build:gradle:2.0.0-beta6
    • And i have Multidex enabled

    My build.gradle file

    apply plugin: 'com.android.application'
    apply plugin: 'com.getkeepsafe.dexcount'
    
    android {
    
        def VERSION_CODE = 52
        def VERSION_NAME = "1.0"
        compileSdkVersion 23
        buildToolsVersion '23.0.2'
    
        defaultConfig {
            applicationId "com.example.app"
            manifestPlaceholders = [appName: "Personal App"]
            minSdkVersion 14
            targetSdkVersion 23
            renderscriptTargetApi 19
            renderscriptSupportModeEnabled true
            versionCode VERSION_CODE
            versionName VERSION_NAME
    
            // Enabling multidex support.
            multiDexEnabled true
        }
    
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
            encoding = 'UTF-8'
        }
    
        signingConfigs {
            livekeystore {
                storeFile file('../key.jks')
                keyAlias 'livekeystore'
                keyPassword '123asd'
                storePassword '123asd'
            }
        }
    
    
        buildTypes {
            release {
                minifyEnabled true
                shrinkResources true
                zipAlignEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
                signingConfig signingConfigs.burgerking
    
                manifestPlaceholders = [googleMapsKey: "@string/release_google_map_key", appNameSuffix: ""]
            }
    
            debug {
                applicationIdSuffix '.dev'
                debuggable true
                minifyEnabled false
                shrinkResources false
                zipAlignEnabled false
    
                manifestPlaceholders = [googleMapsKey: "@string/debug_google_map_key", appNameSuffix: ' (Dev-' + VERSION_CODE + ')']
    
            }
        }
    
        dexOptions {
            incremental true
            javaMaxHeapSize "4g" // 2g should be also OK
        }
    
        useLibrary 'org.apache.http.legacy'
    
    }
    
    repositories {
        maven { url 'https://mint.splunk.com/gradle/' }
        maven { url "http://dl.bintray.com/populov/maven" }
        mavenCentral()
    }
    
    buildscript {
        repositories {
            mavenCentral()
        }
    
        dependencies {
            classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.4.2'
            classpath 'com.newrelic.agent.android:agent-gradle-plugin:4.244.0'
        }
    }
    
    
    dependencies {
        compile 'com.google.code.gson:gson:2.4'
        compile 'com.android.support:appcompat-v7:23.2.0'
        compile 'com.android.support:recyclerview-v7:23.2.0'
        compile 'com.android.support:cardview-v7:23.2.0'
        compile 'com.android.support:design:23.2.0'
        compile 'com.android.support:multidex:1.0.1'
        compile 'com.google.android.gms:play-services-base:8.4.0'
        compile 'com.google.android.gms:play-services-location:8.4.0'
        compile 'com.google.android.gms:play-services-analytics:8.4.0'
        compile 'com.google.android.gms:play-services-maps:8.4.0'
        compile 'com.google.android.gms:play-services-ads:8.4.0'
        compile 'com.googlecode.libphonenumber:libphonenumber:7.0.5'
        compile 'com.facebook.android:facebook-android-sdk:4.1.1'
        compile 'de.greenrobot:eventbus:2.4.0'
        compile 'com.viewpagerindicator:library:2.4.1@aar'
        compile 'com.nineoldandroids:library:2.4.0'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.squareup:pollexor:2.0.2'
        compile 'com.makeramen:roundedimageview:2.1.0'
        compile 'com.mcxiaoke.volley:library:1.0.16@aar'
        compile files('libs/now-auth-api.jar')
        compile 'com.jakewharton:butterknife:5.1.2'
        compile 'com.github.ksoichiro:android-observablescrollview:1.2.0'
        compile 'io.card:android-sdk:5.3.0'
        compile 'com.appboy:android-sdk-ui:1.10.3'
        testCompile 'junit:junit:4.11'
        testCompile('org.mockito:mockito-core:1.9.5') {
            exclude group: 'org.hamcrest'
        }
        testCompile('org.powermock:powermock-module-junit4:1.5') {
            exclude group: 'org.hamcrest'
        }
        testCompile('org.powermock:powermock-api-mockito:1.6.2') {
            exclude group: 'org.hamcrest'
        }
    
        compile 'me.grantland:autofittextview:0.2.1'
    
    }
    

    It seems i am able to get my release build working if i remove minifyEnabled true from it. Why is that, is there another way to solve it

    Adrianne Siavash 2022-08-15
    android - Can you deploy to a device via Gradle from the command line

    What the question says really - can you issue any commands directly to gradlew via the command line to build, package and deploy to a device?

    Iorwerth Endrit 2022-08-17
    gradle - Difference between running lint via Android Studio menu and gradlew command-line

    When I run the following on a command line:

    ./gradlew -lint
    

    I get different results than if I choose the following menu option within Android Studio.

    Analyze->Inspect Code...
    

    Can anyone explain this? Is this normal? Should a prudent developer run both in order to find all potential problems with his/her project?

    Edna Morgen 2022-08-28
    android - React Native Unable to find a matching configuration of project (Build only)

    My react native build works fine when running react-native run-android or cd android && ./gradlew assembleDebug. But I'll get the following for all every react native package I have installed when running ./gradlew assembleRelease

    > Could not resolve project :react-native-fbsdk.
         Required by:
             project :app
          > Unable to find a matching configuration of project :react-native-fbsdk:
              - Configuration 'debugApiElements':
                  - Required com.android.build.api.attributes.BuildTypeAttr 'releaseStaging' and found incompatible value 'debug'.
                  - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
                  - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
                  - Required org.gradle.api.attributes.Usage 'java-runtime' and found incompatible value 'java-api'.
              - Configuration 'debugRuntimeElements':
                  - Required com.android.build.api.attributes.BuildTypeAttr 'releaseStaging' and found incompatible value 'debug'.
                  - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
                  - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
                  - Required org.gradle.api.attributes.Usage 'java-runtime' and found compatible value 'java-runtime'.
              - Configuration 'releaseApiElements':
                  - Required com.android.build.api.attributes.BuildTypeAttr 'releaseStaging' and found incompatible value 'release'.
                  - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
                  - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
                  - Required org.gradle.api.attributes.Usage 'java-runtime' and found incompatible value 'java-api'.
              - Configuration 'releaseRuntimeElements':
                  - Required com.android.build.api.attributes.BuildTypeAttr 'releaseStaging' and found incompatible value 'release'.
                  - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
                  - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
                  - Required org.gradle.api.attributes.Usage 'java-runtime' and found compatible value 'java-runtime'.
    

    Upon getting more details by running ./gradlew assembleRelease --info I found that this message is printed for all of my problematic packages:

    file or directory '/path/to/my/project/node_modules/react-native-fcm/android/libs', not found
    

    Looking in this folder, there is no "libs" folder, and settings.gradle does not tell it to point to a "libs" folder.

    include ':react-native-fcm'
    project(':react-native-fcm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fcm/android')
    

    Should something be generating this folder? I do have compile fileTree(dir: "libs", include: ["*.jar"]) in my app/build.gradle.

    For reference here are some important files:

    build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
            google()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.0'
            classpath 'com.google.gms:google-services:3.1.1'
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            mavenLocal()
            jcenter()
            configurations.all {
                resolutionStrategy {
                    force 'com.facebook.android:facebook-android-sdk:4.28.0'
                }
            }
            maven {
                url "https://maven.google.com"
            }
            maven {
                url "https://jitpack.io"
            }
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
            google()
        }
    }
    

    app/build.gradle

    apply plugin: "com.android.application"
    
    import com.android.build.OutputFile
    
    /**
     * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
     * and bundleReleaseJsAndAssets).
     * These basically call `react-native bundle` with the correct arguments during the Android build
     * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
     * bundle directly from the development server. Below you can see all the possible configurations
     * and their defaults. If you decide to add a configuration block, make sure to add it before the
     * `apply from: "../../node_modules/react-native/react.gradle"` line.
     *
     * project.ext.react = [
     *   // the name of the generated asset file containing your JS bundle
     *   bundleAssetName: "index.android.bundle",
     *
     *   // the entry file for bundle generation
     *   entryFile: "index.android.js",
     *
     *   // whether to bundle JS and assets in debug mode
     *   bundleInDebug: false,
     *
     *   // whether to bundle JS and assets in release mode
     *   bundleInRelease: true,
     *
     *   // whether to bundle JS and assets in another build variant (if configured).
     *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
     *   // The configuration property can be in the following formats
     *   //         'bundleIn${productFlavor}${buildType}'
     *   //         'bundleIn${buildType}'
     *   // bundleInFreeDebug: true,
     *   // bundleInPaidRelease: true,
     *   // bundleInBeta: true,
     *
     *   // whether to disable dev mode in custom build variants (by default only disabled in release)
     *   // for example: to disable dev mode in the staging build type (if configured)
     *   devDisabledInStaging: true,
     *   // The configuration property can be in the following formats
     *   //         'devDisabledIn${productFlavor}${buildType}'
     *   //         'devDisabledIn${buildType}'
     *
     *   // the root of your project, i.e. where "package.json" lives
     *   root: "../../",
     *
     *   // where to put the JS bundle asset in debug mode
     *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
     *
     *   // where to put the JS bundle asset in release mode
     *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
     *
     *   // where to put drawable resources / React Native assets, e.g. the ones you use via
     *   // require('./image.png')), in debug mode
     *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
     *
     *   // where to put drawable resources / React Native assets, e.g. the ones you use via
     *   // require('./image.png')), in release mode
     *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
     *
     *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
     *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
     *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
     *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
     *   // for example, you might want to remove it from here.
     *   inputExcludes: ["android/**", "ios/**"],
     *
     *   // override which node gets called and with what additional arguments
     *   nodeExecutableAndArgs: ["node"],
     *
     *   // supply additional arguments to the packager
     *   extraPackagerArgs: []
     * ]
     */
    
    project.ext.react = [
        entryFile: "index.js"
    ]
    
    apply from: "../../node_modules/react-native/react.gradle"
    apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
    
    /**
     * Set this to true to create two separate APKs instead of one:
     *   - An APK that only works on ARM devices
     *   - An APK that only works on x86 devices
     * The advantage is the size of the APK is reduced by about 4MB.
     * Upload all the APKs to the Play Store and people will download
     * the correct one based on the CPU architecture of their device.
     */
    def enableSeparateBuildPerCPUArchitecture = false
    
    /**
     * Run Proguard to shrink the Java bytecode in release builds.
     */
    def enableProguardInReleaseBuilds = false
    
    android {
        compileSdkVersion 26
        buildToolsVersion "26.0.2"
    
        defaultConfig {
            applicationId "com.gauge"
            minSdkVersion 16
            targetSdkVersion 26
            multiDexEnabled true
            versionCode 24
            versionName "1.2.9"
            ndk {
                abiFilters "armeabi-v7a", "x86"
            }
        }
        signingConfigs {
            release {
                if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                    storeFile file(MYAPP_RELEASE_STORE_FILE)
                    storePassword MYAPP_RELEASE_STORE_PASSWORD
                    keyAlias MYAPP_RELEASE_KEY_ALIAS
                    keyPassword MYAPP_RELEASE_KEY_PASSWORD
                }
            }
        }
        splits {
            abi {
                reset()
                enable enableSeparateBuildPerCPUArchitecture
                universalApk false  // If true, also generate a universal APK
                include "armeabi-v7a", "x86"
            }
        }
        buildTypes {
            debug {
                // Note: CodePush updates should not be tested in Debug mode as they are overriden by the RN packager. However, because CodePush checks for updates in all modes, we must supply a key.
                buildConfigField "String", "CODEPUSH_KEY", '""'
            }
            releaseStaging {
                minifyEnabled enableProguardInReleaseBuilds
                signingConfig signingConfigs.release
                buildConfigField "String", "CODEPUSH_KEY", '"1psOppiGxP0-cJpCePhMqgEjeO4l2533309f-9929-415c-8999-d7fda42c3857"'
            }
            release {
                minifyEnabled enableProguardInReleaseBuilds
                proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
                signingConfig signingConfigs.release
                buildConfigField "String", "CODEPUSH_KEY", '"0wPxPhihmtxxEdma3mU4zIGIFNdi2533309f-9929-415c-8999-d7fda42c3857"'
            }
        }
        // applicationVariants are e.g. debug, release
        applicationVariants.all { variant ->
            variant.outputs.each { output ->
                // For each separate APK per architecture, set a unique version code as described here:
                // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
                def versionCodes = ["armeabi-v7a":1, "x86":2]
                def abi = output.getFilter(OutputFile.ABI)
                if (abi != null) {  // null for the universal-debug, universal-release variants
                    output.versionCodeOverride =
                            versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
                }
            }
        }
    }
    
    buildscript {
        repositories {
            maven { url 'https://maven.fabric.io/public' }
        }
        dependencies {
            classpath 'io.fabric.tools:gradle:1.22.1'
        }
    }
    
    apply plugin: 'io.fabric'
    
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }
    
    dependencies {
        compile project(':react-native-code-push')
        compile (project(':react-native-code-push')) {
            exclude(group: 'android.arch.core')
        }
        compile project(':react-native-config')
        compile project(':react-native-vector-icons')
        compile(project(':react-native-radar')) {
            exclude group: 'com.google.android.gms'
            exclude module: 'support-v4'
        }
        compile project(':react-native-push-notification')
        compile project(':react-native-photo-view')
        compile project(':react-native-linear-gradient')
        compile project(':react-native-image-picker')
        compile project(':react-native-fcm')
        compile fileTree(dir: "libs", include: ["*.jar"])
        compile(project(':react-native-fbsdk')){
            exclude(group: 'com.facebook.android', module: 'facebook-android-sdk')
        }
        compile "com.facebook.android:facebook-android-sdk:4.22.1"
        compile "com.android.support:appcompat-v7:26.0.2"
        compile "com.facebook.react:react-native:+"  // From node_modules
        compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
          transitive = true
        }
        compile 'com.android.support:multidex:1.0.2'
        compile "com.google.android.gms:play-services-location:12.0.0"
    }
    
    // Run this once to be able to run the application with BUCK
    // puts all compile dependencies into folder libs for BUCK to use
    task copyDownloadableDepsToLibs(type: Copy) {
        from configurations.compile
        into 'libs'
    }
    
    // ADD THIS AT THE BOTTOM
    apply plugin: 'com.google.gms.google-services'
    

    settings.gradle

    rootProject.name = 'MyProject'
    
    include ':app'
    
    include ':react-native-vector-icons'
    project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
    include ':react-native-radar'
    project(':react-native-radar').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-radar/android')
    include ':react-native-push-notification'
    project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
    include ':react-native-photo-view'
    project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android')
    include ':react-native-linear-gradient'
    project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
    include ':react-native-image-picker'
    project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
    include ':react-native-fcm'
    project(':react-native-fcm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fcm/android')
    include ':react-native-code-push'
    project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
    include ':react-native-intercom'
    project(':react-native-intercom').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-intercom/android')
    include ':react-native-video'
    project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
    include ':react-native-fbsdk'
    project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')
    include ':react-native-config'
    project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
    

    Update: I created a clean project with react-native init and ran the build and it created the same problem, so I guess it's something specific to my environment or there is some kind of temporary problem with the dependencies.

    Update: Built everything on a Windows machine. Same problem.

    Update: I have been able to get certain versions of this working, but not the main project. It might be due to these warnings:

    Configuration 'compile' in project ':react-native-code-push' is deprecated. Use 'implementation' instead.
    WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1.
    Android SDK Build Tools 26.0.2 will be used.
    To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
    
    Vimal Anderson 2022-08-26
    android - org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V'

    I'm unable to build the project after updating android studio to 3.4. can anyone please help me.

    Unable to find method 'org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V'.
    Possible causes for this unexpected error include:
    Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
    Re-download dependencies and sync project (requires network)
    
    The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
    Stop Gradle build processes (requires restart)
    
    Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
    
    In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
    
    Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':LogManagerAndroidProject'.
            at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:79)
            at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:72)
            at org.gradle.configuration.project.LifecycleProjectEvaluator.access$600(LifecycleProjectEvaluator.java:53)
            at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:198)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
            at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
            at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:111)
            at org.gradle.internal.Factories$1.create(Factories.java:25)
            at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:200)
            at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:186)
            at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:95)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
            at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
            at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:67)
            at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:693)
            at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:141)
            at org.gradle.api.internal.project.DefaultProjectAccessListener.evaluateProjectAndDiscoverTasks(DefaultProjectAccessListener.java:32)
            at org.gradle.api.internal.project.DefaultProjectAccessListener.beforeResolvingProjectDependency(DefaultProjectAccessListener.java:28)
            at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency.beforeResolved(DefaultProjectDependency.java:101)
            at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.ProjectIvyDependencyDescriptorFactory.createDependencyDescriptor(ProjectIvyDependencyDescriptorFactor
    y.java:41)
            at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultDependencyDescriptorFactory.createDependencyDescriptor(DefaultDependencyDescriptorFactory.java
    :46)
            at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultLocalConfigurationMetadataBuilder.addDependencies(DefaultLocalConfigurationMetadataBuilder.jav
    a:58)
            at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultLocalConfigurationMetadataBuilder.addDependenciesAndExcludes(DefaultLocalConfigurationMetadata
    Builder.java:48)
            at org.gradle.internal.component.local.model.DefaultLocalComponentMetadata$DefaultLocalConfigurationMetadata.realizeDependencies(DefaultLocalComponentMetadata.java:499)
            at org.gradle.internal.component.local.model.DefaultLocalComponentMetadata$DefaultLocalConfigurationMetadata.addDefinedExcludes(DefaultLocalComponentMetadata.java:456)
            at org.gradle.internal.component.local.model.DefaultLocalComponentMetadata$DefaultLocalConfigurationMetadata.getExcludes(DefaultLocalComponentMetadata.java:447)
            at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.getModuleResolutionFilter(NodeState.java:384)
            at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.visitOutgoingDependencies(NodeState.java:192)
            at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:169)
            at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:131)
            at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:121)
            at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:171)
            at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveGraph(ShortCircuitEmptyConfigurationResolver.java:86)
            at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveGraph(ErrorHandlingConfigurationResolver.java:73)
            ... 160 more
    Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
            at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:86)
            at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)
            at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)
            at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
            at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
            at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
            at com.sun.proxy.$Proxy26.afterEvaluate(Unknown Source)
            at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:190)
            at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:187)
            at org.gradle.api.internal.project.DefaultProject.stepEvaluationListener(DefaultProject.java:1419)
            at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:196)
            ... 196 more
    Caused by: java.lang.NoSuchMethodError: org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V
            at com.android.build.gradle.tasks.factory.JavaCompileConfigAction.execute(JavaCompileConfigAction.java:82)
            at com.android.build.gradle.tasks.factory.JavaCompileConfigAction.execute(JavaCompileConfigAction.java:34)
            at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:360)
            at com.android.build.gradle.internal.TaskContainerAdaptor.create(TaskContainerAdaptor.java:59)
            at com.android.build.gradle.internal.scope.AndroidTaskRegistry.create(AndroidTaskRegistry.java:47)
            at com.android.build.gradle.internal.scope.AndroidTaskRegistry.create(AndroidTaskRegistry.java:89)
            at com.android.build.gradle.internal.TaskManager.createJavacTask(TaskManager.java:1124)
            at com.android.build.gradle.internal.LibraryTaskManager.lambda$createTasksForVariantData$9(LibraryTaskManager.java:215)
            at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
            at com.android.build.gradle.internal.LibraryTaskManager.createTasksForVariantData(LibraryTaskManager.java:206)
            at com.android.build.gradle.internal.VariantManager.createTasksForVariantData(VariantManager.java:460)
            at com.android.build.gradle.internal.VariantManager.lambda$createAndroidTasks$1(VariantManager.java:282)
            at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
            at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:278)
            at com.android.build.gradle.BasePlugin.lambda$createAndroidTasks$6(BasePlugin.java:601)
            at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
            at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:596)
            at com.android.build.gradle.BasePlugin.lambda$null$4(BasePlugin.java:526)
            at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
            at com.android.build.gradle.BasePlugin.lambda$createTasks$5(BasePlugin.java:522)
            at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1$1.run(DefaultListenerBuildOperationDecorator.java:150)
            at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.reapply(DefaultUserCodeApplicationContext.java:58)
            at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1.run(DefaultListenerBuildOperationDecorator.java:147)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
            at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction.execute(DefaultListenerBuildOperationDecorator.java:144)
            at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)
            at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
            at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
            at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
            at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
            at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
            ... 206 more
    
    Iorwerth Endrit 2022-09-05
    gradle - Android Studio Build/Clean

    In an attempt to compile external jars, I have to use the terminal and do a clean. However, when I go into the root directory of my project and execute

    gradlew clean

    I get the following message:

    -bash: gradlew: command not found

    Here's a screenshot of my application folder's home directory.

    Let me know if you need anything else, I'm not sure why this is happening.

    Markos Agatha 2022-08-24
    command line - Specifying output location when assembling an Android project with Gradle via Terminal?

    I'm trying to automate the build and upload process for a signed APK of an Android app without using Android Studio, so I'm running everything in Terminal. The first command is:

    ./gradlew assembleRelease
    

    Which generates an unsigned, unaligned APK in the /APP NAME/build/outputs/apk folder. However, since APP NAME won't be the same for every app, I can't just hard code the location of the output file into the next step of signing it. Are there any arguments I can use with the gradlew command to specify an output directory and file name of my choice?

    Ibrahim Yaron 2022-09-23
    Android Studio - Unable to build project - GradleConnectionException

    I'm on Android Studio 0.3.2. Since I upgraded from previous version, unable to build existing projects.

    I'm consistently having gradle integration problems. I spend more time sorting out gradle than writing any code. I've been stumped for one week now!

    I get the error mentioned on so many posts, but after reading for hours none of the solutions have worked for me.

    org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation 'C:\Users\Adrian.gradle\wrapper\dists\gradle-1.8-all\2kopnp0i5dq014k75fp36m3vd5\gradle-1.8'.: Could not execute build using Gradle installation 'C:\Users\Adrian.gradle\wrapper\dists\gradle-1.8-all\2kopnp0i5dq014k75fp36m3vd5\gradle-1.8'.

    I checked my gradle version using the built in terminal window in android studio.

    gradlew --version in terminal window

    My gradle.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <project version="4">
      <component name="GradleSettings">
        <option name="linkedExternalProjectsSettings">
          <GradleProjectSettings>
            <option name="distributionType" value="DEFAULT_WRAPPED" />
            <option name="externalProjectPath" value="$PROJECT_DIR$" />
            <option name="useAutoImport" value="true" />
          </GradleProjectSettings>
          <GradleProjectSettings>
            <option name="distributionType" value="DEFAULT_WRAPPED" />
            <option name="externalProjectPath" value="D:\Users\Adrian\AndroidStudioProjects\SupaScaleProject" />
            <option name="useAutoImport" value="true" />
          </GradleProjectSettings>
        </option>
        <option name="serviceDirectoryPath" value="$USER_HOME$/.gradle" />
      </component>
    </project>
    

    My gradle-wrapper.properties

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip  
    

    My build.gradle

    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.6.+'
        }
    }
            apply plugin: 'android'
    
       repositories {
            mavenCentral()
    }
    
    android {
        compileSdkVersion 18
        buildToolsVersion "18.1.1"
    
        defaultConfig {
            minSdkVersion 14
            targetSdkVersion 18
        }
    
        buildTypes {
            release {
                runProguard true
                proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
            }
    
            debug {
                runProguard false
                proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
            }
        }
    
     }
    
    dependencies {
        compile 'com.android.support:support-v4:13.0.+'
        compile files('libs/achartengine-1.1.0.jar')
    }
    

    I do a build from the Terminal: gradlew compileDebug and the build is successful!

    enter image description here

    Now I build form the Menu bar Build -> Rebuild Project (in AndroidStudio 0.3.2):

    enter image description here

    I really don't know where to look anymore. Any help will be appreciated.

    Oh .. yes I have deleted all the files in .gradle/wrapper/dists/ and allowed Android Studio to download for me.

    Thanks in advance.

    Adrian

    Following @joucks comment, I noticed the following at http://tools.android.com/knownissues:

    enter image description here

    So I changed my build.gradle to classpath 'com.android.tools.build:gradle:0.6.3' unfortunately still the same result.

    Thereafter I updated the compileSDKVersion to 19, and the buildToolsVersion to "19.0.0", hoping for some success. Unfortunately none. Yes .. and before you ask, my SDK-Manager is up to date with all the latest files.

    Pétur Gulnara 2022-09-28
    android - ./gradlew lint says "no issues", but Analyze -> Inspect Code finds issues

    I´m having a weird problem in Android Studio: The manually started linter via

    Analyze -> Inspect Code -> "Whole project"
    

    Finds some issues, however if I do it

    ./gradlew lint
    

    in the console, it says

    Ran lint on variant release: 0 issues found

    Ran lint on variant debug: 0 issues found

    I have no lintOptins in my gradle file, but use a lint.xml, here it is:

    <?xml version="1.0" encoding="UTF-8"?>
    <lint>
      <issue id="all">
        <ignore path="build" />
      </issue>
      <issue id="all">
        <ignore path="businesslogic/build" />
      </issue> 
    </lint>
    

    My question: How to make console show same errors as Inspection in android studio?

    Sitora Meresankh 2022-09-27
    Android Studio: "Use default gradle wrapper" vs. "Use customizable gradle wrapper"

    What exactly is the difference between Android Studio's Gradle options:

    Android Studio->Preferences->Gradle

    Use default gradle wrapper (recommended) and Use customizable gradle wrapper?

    Background:

    I am working on an Android project in Android Studio and using a Gradle wrapper.

    However, when I use the Android Studio settings "Use customizable gradlew wrapper" every time my team members sync the Android Studio project using the gui command:

    enter image description here

    they find the gradle/wrapper/gradle-wrapper.properties date being updated (and resulting in a extra diffs on the git repo).

    Switching to "Use default gradle wrapper" seems to solve this issue.

    Ibrahim Yaron 2022-08-20
    android - Why did gradlew :app:dependencyInsight fail?

    I try to run this command to list all the dependencies of firebase-messaging library :

    gradlew :app:dependencyInsight --configuration compile --dependency firebase-messaging
    

    but it's return me :

    :app:dependencyInsight No dependencies matching given input were found in configuration ':app:compile'

    BUILD SUCCESSFUL in 0s 1 actionable task: 1 executed

    this is my build.gradle file :

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 27
        defaultConfig {
            applicationId "com.example.test.myapplication"
            minSdkVersion 15
            targetSdkVersion 27
            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'])
        implementation 'com.android.support:appcompat-v7:27.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        implementation 'com.android.support:design:27.1.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
        implementation 'com.google.firebase:firebase-messaging:12.0.1'
    }
    

    What i did wrong ?

    Edna Morgen 2022-09-21
    android - What does a gradlew do

    I got a project which was a eclipse project. And now I'm using Android Studio with gradle 2.2.1. I've found that when I create a project with Android Studio, it will generate a gradlew file, and it may include some CLI functions. But when I transfer my project from eclipse to Android Studio, I didn't find my gradlew file. So, here is my question: what does a gradlew file exactly do? Can it be customized?

    Sydnee Vesa 2022-10-08
    java - gradlew missing in generated android project

    Okay I'm trying to do some android developing via command line / with an alternative IDE.

    I have the following path variables set up:

    • jdk1.8.0_40/bin/
    • android-sdk-linux/tools/
    • android-studio/bin/
    • android-sdk-linux/platform-tools/

    I run this command to make a project:

    android create project --target 2 --name MyFirstApp --path ./MyFirstApp --activity MyActivity --package com.example.myfirstapp
    

    The tutorial tells me to cd into MyFirstApp and run.

    gradlew assembleRelease
    

    There is no gradlew in this directory!

    $ cd MyFirstApp/
    $ ls
    AndroidManifest.xml  build.xml         proguard-project.txt  src
    ant.properties       libs              project.properties
    bin                  local.properties  res
    

    I've been trying for days but I need help doing this:

    Use Gradle to build your project in debug mode, invoke the assembleDebug build task using the Gradle wrapper script (gradlew assembleRelease).

    Ganesh Quique 2022-10-09
    android - Error when compiling with Gradle (can't find downloaded dependencies)

    I develop an app generation system that is regenerating apps by command line Gradle compilation commands.

    In my Windows Server 2008, I'm facing a problem after updating to the last Gradle version and Gradle plugin version.

    When compiling I'm getting this errors:

    C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.0.0.aar\e93435c34d5cae8b6677dcef529711a5\res\drawable-xxhdpi-v4\abc_text_select_handle_middle_mtrl_light.png: error: file not found.
    
    C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.0.0.aar\e93435c34d5cae8b6677dcef529711a5\res\drawable\abc_btn_colored_material.xml: error: file not found.
    
    C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.0.0.aar\e93435c34d5cae8b6677dcef529711a5\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png: error: file not found.
    
    and a lot more of errors like those...
    

    I'm not sure why I'm getting this error, because the file is correctly downloaded and it's correctly located on that exactly direction.

    It has a path length of 204 characters, so supposedly it's not surpassing the limit of 255 path characters on NTFS Windows file system.

    It is possible to change the location where Gradle downloads it's cached dependencies? Is this problem caused by this or by other thing?

    Seher Ernesto 2022-10-24
    Why won't Android Studio create my AAR file in release mode

    Using Android Studio, I have an Android library project which produces 'library/build/outputs/aar/MyLIB.aar" just fine in Debug mode, but does not do so in Release mode. I see no errors, just "BUILD SUCCESSFUL" in the "Gradle Console" window but no Release Mode artifact.

    There was a similar question raised here, and I'm getting the same behavior as #user1624552 mentions in the link:

    "gradlew clean" followed by "gradlew aR" resultd in my AAR being created and correctly placed in the directory above. But using Android Studio and the "Release Mode" Build Variant does NOT create an AAR file.

    Is there something configured in the Debug variant which is not configured in the Release variant?

    Thanks, ALF

    Orion Waman 2022-10-17
    Findbugs android gradle plugin

    I have an android project. I want to introduce findbugs in my project as a gradle plugin. I tried to edit the project's build.gradle as below.

    buildscript {
        repositories {
            mavenCentral()
            maven { url 'https://maven.fabric.io/public' }
               }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0+'
        classpath 'io.fabric.tools:gradle:1.+'
    
        }
    }
    
    apply plugin: "java"
    apply plugin: "findbugs"
    findbugs {
      toolVersion = "2.0.1"
      sourceSets = [sourceSets.main]
      ignoreFailures = false
      reportsDir = file("$project.buildDir/findbugsReports")
      effort = "max"
      reportLevel = "high"
      includeFilter =     file("$rootProject.projectDir/config/findbugs/includeFilter.xml")
      excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml")
     }
    

    Is this plugin correct? Does anything neeed to be added or removed? Now what should I do to get the results of this findbugs check? What gradle command should I use?

    Passang Sisko 2022-09-29
    android - gradlew build freezing at mergeDebugResources

    I build debug app use gradlew as in google tutorial https://developer.android.com/training/basics/firstapp/running-app.html

    I was created project use

    android create project --target 2 -g -v 2.9--name myAppName --path ./MyAppDirectory --activity MyActivity --package com.mypackage
    

    and this is my build.gradle file

    buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
    }
    
    apply plugin: 'android'
    
    android {
        compileSdkVersion 'Google Inc.:Google APIs:23'
        buildToolsVersion '23.0.2'
    
    buildTypes {
        release {
            //runProguard false
              //minifyEnabled true
            proguardFile getDefaultProguardFile('proguard-android.txt')
        }
    }
    }
    

    I build debug app use command

    $ ./gradlew assembleDebug
    

    and building is freezing at 40% as

        :preBuild UP-TO-DATE
    :preDebugBuild UP-TO-DATE
    :checkDebugManifest
    :prepareDebugDependencies
    :compileDebugAidl UP-TO-DATE
    :compileDebugRenderscript UP-TO-DATE
    :generateDebugBuildConfig UP-TO-DATE
    :generateDebugAssets UP-TO-DATE
    :mergeDebugAssets UP-TO-DATE
    :generateDebugResValues UP-TO-DATE
    :generateDebugResources UP-TO-DATE
    :mergeDebugResources
    java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
        at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
        at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
        at java.lang.ProcessImpl.start(ProcessImpl.java:130)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
        ... 4 more
    java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
        at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
        at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
    Thread(png-cruncher_5) has a null payload
        at java.lang.ProcessImpl.start(ProcessImpl.java:130)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
        ... 4 more
    Thread(png-cruncher_3) has a null payload
    java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
        at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
        at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
        at java.lang.ProcessImpl.start(ProcessImpl.java:130)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
        ... 4 more
    Thread(png-cruncher_2) has a null payload
    java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
        at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
        at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
        at java.lang.ProcessImpl.start(ProcessImpl.java:130)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
        ... 4 more
    Thread(png-cruncher_1) has a null payload
    java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
        at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
        at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
        at java.lang.ProcessImpl.start(ProcessImpl.java:130)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
        ... 4 more
    > Building 40% > :mergeDebugResources
    

    `

    Raja Prateek 2022-10-02
    android - Gradle 3.0.0-beta1 build issue

    I just updated the gradle version to

    classpath 'com.android.tools.build:gradle:3.0.0-beta1'
    

    after updating android studio to 3.0-beta1, and my gradle-wrapper is:

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
    

    the problem is I'm facing this weird issue when I want to Gradle-sync the project:

    Error:Cause: java.lang.NullPointerException
    at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77)
    at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
    at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
    at java.nio.file.Paths.get(Paths.java:84)
    at com.android.build.gradle.internal.scope.BuildOutput.getOutputPath(BuildOutput.java:222)
    at com.android.build.gradle.internal.scope.BuildOutputs.lambda$load$2(BuildOutputs.java:243)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1376)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:245)
    at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:184)
    at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:140)
    at com.android.build.gradle.internal.ide.BuildOutputsSupplier.lambda$get$1(BuildOutputsSupplier.java:55)
    at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:397)
    at com.android.build.gradle.internal.ide.BuildOutputsSupplier.get(BuildOutputsSupplier.java:50)
    at com.android.build.gradle.internal.ide.BuildOutputsSupplier.get(BuildOutputsSupplier.java:35)
    at com.android.build.gradle.internal.ide.AndroidArtifactImpl.getOutputs(AndroidArtifactImpl.java:134)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$ReflectionMethodInvoker.invoke(ProtocolToModelAdapter.java:592)
    at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$AdaptingMethodInvoker.invoke(ProtocolToModelAdapter.java:397)
    at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$PropertyCachingMethodInvoker.invoke(ProtocolToModelAdapter.java:625)
    at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SafeMethodInvoker.invoke(ProtocolToModelAdapter.java:647)
    at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SupportedPropertyInvoker.invoke(ProtocolToModelAdapter.java:670)
    at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$InvocationHandlerImpl.invoke(ProtocolToModelAdapter.java:356)
    at com.sun.proxy.$Proxy204.getOutputs(Unknown Source)
    at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidArtifactImpl.<init>(IdeAndroidArtifactImpl.java:57)
    at com.android.tools.idea.gradle.project.model.ide.android.IdeVariantImpl.lambda$new$1(IdeVariantImpl.java:63)
    at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.lambda$computeIfAbsent$0(ModelCache.java:31)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
    at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.computeIfAbsent(ModelCache.java:31)
    at com.android.tools.idea.gradle.project.model.ide.android.IdeModel.copy(IdeModel.java:74)
    at com.android.tools.idea.gradle.project.model.ide.android.IdeVariantImpl.<init>(IdeVariantImpl.java:62)
    at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.lambda$new$4(IdeAndroidProjectImpl.java:88)
    at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.lambda$computeIfAbsent$0(ModelCache.java:31)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
    at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.computeIfAbsent(ModelCache.java:31)
    at com.android.tools.idea.gradle.project.model.ide.android.IdeModel.copy(IdeModel.java:74)
    at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.<init>(IdeAndroidProjectImpl.java:87)
    at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.<init>(IdeAndroidProjectImpl.java:68)
    at com.android.tools.idea.gradle.project.model.AndroidModuleModel.<init>(AndroidModuleModel.java:131)
    at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.populateModuleContentRoots(AndroidGradleProjectResolver.java:214)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:103)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:366)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$200(GradleProjectResolver.java:79)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:902)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:886)
    at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:218)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:139)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:79)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:45)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:66)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:139)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:125)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:388)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:445)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:137)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    

    I've checked everything and they all look fine, can anyone help?

    Tzafrir Prokopis 2022-09-25
    java - Android - Can't compile on JRE - Make sure Gradle is running on a JDK, not JRE

    I want to compile my app from command line, and not from Android Studio. My app works perfectly when I launch it from Android Studio to my device / emulator, however when I try to do :

    gradlew build
    

    I get :

    > Task :app:kaptGenerateStubsReleaseKotlin FAILED
    Caught an exception trying to connect to Kotlin Daemon
    org.gradle.api.GradleException: Kotlin could not find the required JDK tools in the Java installation 'C:\Program Files (x86)\Java\jre1.8.0_191' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
            at org.jetbrains.kotlin.gradle.tasks.JarSearchingUtilKt.findToolsJar(jarSearchingUtil.kt:95)
            at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$toolsJar$2.invoke(GradleCompilerEnvironment.kt:23)
            at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$toolsJar$2.invoke(GradleCompilerEnvironment.kt:17)
            at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:131)
            ...
    

    Here is my JAVA_HOME env var :

    JAVA_HOME=C:\Program Files (x86)\Java\jre1.8.0_191
    

    It IS actually a JRE (and not a JDK), but, when I change my env var by my JDK as following :

    JAVA_HOME=C:\Program Files\Java\jdk-11.0.1    
    

    And I launch :

    gradlew build
    

    Then I get :

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine java version from '11.0.1'.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    Krisztina Promise 2022-11-01
    android - How to execute a command in windows cmd using Gradle?

    I am trying to execute this command using Gradle .

    .\build\build.exe parse /p 246 /o ".\strings.xml.bcg" /novalidate /l 1033 /sr "@LbaRoot@\settings\default\lss\default.config" "..\app\src\main\res\values\strings.xml"
    

    This works fine when I execute in command Line. I am trying to replicate the behaviour using Gradle

        task runLSBuild(type:Exec) {
        workingDir '../outer_build'
    
        //on windows:
        commandLine '.\\build\\build.exe','parse /p 246 /o ".\\strings.xml.bcg" /novalidate /l 1033 /sr "@LbaRoot@\\settings\\default\\lss\\default.config" "..\\app\\src\\main\\res\\values\\strings.xml"'
    }
    

    But this fails with error ".\build\build.exe", The system cannot find the file specified. I need to run the program with working directory as outer_build.

    Any suggestions on where am I going wrong ?

    Winnie Zubin 2022-10-15
    android - Getting error "Gradle version 1.10 is required. Current version is 1.12." when executing "gradle wrapper"?

    I'm trying to execute gradle wrapper for an Android project, and this error is raised:

    A problem occurred evaluating root project 'myapp'.

    > Gradle version 1.10 is required. Current version is 1.12. If using the gradle wrapper, try editing the distributionUrl in /Users/dude/myapp/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip

    My wrapper task in build.gradle looks like this:

    task wrapper(type: Wrapper) {
        gradleVersion = "1.12"
    }
    

    I recently updated to Gradle v1.12 via Homebrew. Is it not supported or something? If so, where can I check this sort of thing?

    Ganesh Quique 2022-09-19
    android - React Native: "Failed to read key from keystore" when trying to generate apk file

    When I try to follow the docs in https://facebook.github.io/react-native/docs/signed-apk-android.html to generate the apk file for a react-native app,I got the error described in the title above. I have already checked to make sure that the alias and password of my keystore are correct, so I'm not sure what the problem is. I have also made sure that I entered all the information required when generating the keystore.

    Below is the stacktrace of the output I get from running the command gradlew assembleRelease inside the android directory.

    :app:packageRelease (Thread[main,5,main]) started.
    :app:packageRelease
    Executing task ':app:packageRelease' (up-to-date check took 0.092 secs) due to:
      No history is available.
    All input files are considered out-of-date for incremental task ':app:packageRel
    ease'.
    :app:packageRelease FAILED
    :app:packageRelease (Thread[main,5,main]) completed. Took 0.151 secs.
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:packageRelease'.
    > Failed to read key from keystore
    
    * Try:
    Run with --debug option to get more log output.
    
    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:pac
    kageRelease'.
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
    ecuteActions(ExecuteActionsTaskExecuter.java:69)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
    ecute(ExecuteActionsTaskExecuter.java:46)
            at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExec
    uter.execute(PostExecutionAnalysisTaskExecuter.java:35)
            at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.exec
    ute(SkipUpToDateTaskExecuter.java:64)
            at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execut
    e(ValidatingTaskExecuter.java:58)
            at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecu
    ter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
            at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter
    .execute(SkipTaskWithNoActionsExecuter.java:52)
            at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execut
    e(SkipOnlyIfTaskExecuter.java:53)
            at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter
    .execute(ExecuteAtMostOnceTaskExecuter.java:43)
            at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailur
    e(AbstractTask.java:310)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorW
    orker.executeTask(AbstractTaskPlanExecutor.java:79)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorW
    orker.processTask(AbstractTaskPlanExecutor.java:63)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorW
    orker.run(AbstractTaskPlanExecutor.java:51)
            at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(Defaul
    tTaskPlanExecutor.java:23)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(Defau
    ltTaskGraphExecuter.java:88)
            at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTask
    ExecutionAction.java:37)
            at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
    r.java:62)
            at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExec
    uter.java:23)
            at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecu
    ter.java:68)
            at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildEx
    ecutionAction.java:32)
            at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
    r.java:62)
            at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
    r.java:55)
            at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
    GradleLauncher.java:149)
            at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
    Launcher.java:106)
            at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
    cher.java:86)
            at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon
    troller.run(InProcessBuildActionExecuter.java:90)
            at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(Exe
    cuteBuildActionRunner.java:28)
            at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildA
    ctionRunner.java:35)
            at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
    ssBuildActionExecuter.java:41)
            at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
    ssBuildActionExecuter.java:28)
            at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.exe
    cute(DaemonUsageSuggestingBuildActionExecuter.java:50)
            at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.exe
    cute(DaemonUsageSuggestingBuildActionExecuter.java:27)
            at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:40)
            at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.jav
    a:169)
            at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
    execute(CommandLineActionFactory.java:237)
            at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
    execute(CommandLineActionFactory.java:210)
            at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
    meValidationAction.java:35)
            at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
    meValidationAction.java:24)
            at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
    CommandLineActionFactory.java:206)
            at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
    CommandLineActionFactory.java:169)
            at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
    ortingAction.java:33)
            at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
    ortingAction.java:22)
            at org.gradle.launcher.Main.doAction(Main.java:33)
            at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
            at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots
    trap.java:54)
            at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j
    ava:35)
            at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
            at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.ja
    va:30)
            at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
            at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
    Caused by: org.gradle.tooling.BuildException: Failed to read key from keystore
            at com.android.build.gradle.tasks.PackageApplication.doFullTaskAction(Pa
    ckageApplication.java:226)
            at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(In
    crementalTask.java:79)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
    actory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:243)
    
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
    actory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
    actory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:230)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
    actory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
    ecuteAction(ExecuteActionsTaskExecuter.java:80)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
    ecuteActions(ExecuteActionsTaskExecuter.java:61)
            ... 49 more
    Caused by: com.android.builder.packaging.SigningException: Failed to read key fr
    om keystore
            at com.android.builder.core.AndroidBuilder.packageApk(AndroidBuilder.jav
    a:1775)
            at com.android.build.gradle.tasks.PackageApplication.doFullTaskAction(Pa
    ckageApplication.java:206)
            ... 57 more
    
    
    BUILD FAILED
    

    I can't make sense of the stacktrace.

    Part of my build.gradle file in my android/app folder is shown below:

    signingConfigs {
                release {
                    storeFile file(MYAPP_RELEASE_STORE_FILE)
                    storePassword MYAPP_RELEASE_STORE_PASSWORD
                    keyAlias MYAPP_RELEASE_KEY_ALIAS
                    keyPassword MYAPP_RELEASE_KEY_PASSWORD
                }
            }
        splits {
            abi {
                reset()
                enable enableSeparateBuildPerCPUArchitecture
                universalApk false  // If true, also generate a universal APK
                include "armeabi-v7a", "x86"
            }
        }
        buildTypes {
            release {
                minifyEnabled enableProguardInReleaseBuilds
                proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
                signingConfig signingConfigs.release
            }
        }
    

    while the gradle.properties file in my android folder is shown below:

    android.useDeprecatedNdk=true
    MYAPP_RELEASE_STORE_FILE=my-key.keystore
    MYAPP_RELEASE_KEY_ALIAS=lew                 
    MYAPP_RELEASE_STORE_PASSWORD= ****
    MYAPP_RELEASE_KEY_PASSWORD= ****
    
    Salvatrix Ngải 2022-11-04
    android - Gradle does not generate an output APK

    I'm trying to generate an APK for my android project on the command line. I am running

    ./gradlew clean assembleProductionDebug
    

    The output I get is:

    :app:processProductionDebugManifest
    :app:processProductionDebugResources
    :app:generateProductionDebugSources
    :app:compileProductionDebugJava
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    :app:preDexProductionDebug
    :app:dexProductionDebug
    :app:processProductionDebugJavaRes UP-TO-DATE
    :app:validateDebugSigning
    :app:packageProductionDebug
    :app:zipalignProductionDebug
    :app:assembleProductionDebug
    
    BUILD SUCCESSFUL
    
    Total time: 2 mins 29.574 secs
    

    However, my build/outputs folder is empty. The same happens when I run ./gradlew assemble

    The only relevant thing I could search for is potentially https://gradle.org/docs/current/dsl/org.gradle.language.assembler.tasks.Assemble.html but how do I specify the objectFileDir in the build.gradle?

    Note: running

    ./gradlew clean installProductionDebug
    

    does successfully install the APK on my device.

    Relevant build.gradle:

    apply plugin: 'com.android.application'
    apply plugin: 'git-dependencies'
    apply plugin: 'testfairy'
    apply plugin: 'org.robolectric'
    
    
    android {
        compileSdkVersion 21
        buildToolsVersion "21.1.2"
    
        defaultConfig {
            applicationId "com.test.androidas"
            minSdkVersion 15
            targetSdkVersion 21
            versionCode 1
            versionName "1.0"
        }
    
        signingConfigs {
            release {
                 storeFile file("as.keystore")
                 storePassword "***"
                 keyAlias "as"
                 keyPassword "***"
            }
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                signingConfig signingConfigs.release
            }
        }
    
    
        productFlavors {
            production {
                applicationId "com.antsquare.test"
                versionCode 1
            }
    
            staging {
                applicationId "com.antsquare.test.staging"
                versionCode 1
            }
        }
    
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES.txt'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/dependencies.txt'
            exclude 'META-INF/LGPL2.1'
        }
    
        testfairyConfig {
            apiKey '***'
            video "wifi"
            notify true
            testersGroups "ME"
            autoUpdate true
            videoQuality "low"
            videoRate "0.5"
        }
    }
    
    Cher Samanta 2022-10-31
    How to create local.properties for android project in jenkins?

    We have an android project for an application, it builds without any error on our local machines. Recently had to configure jenkins for the same.

    Every time we run the job the BUILD FAILED. Looking for the solution to the error we got to know that the local.properties is missing in the jenkins jobs workspace of our project.

    Usually this file is created locally by Android Studio. Is there any way to get this done using gradle commands or code changes? For our jenkins sdk.dir = "/var/lib/jenkins/tools/android-sdk"

    Thanks

    Krisztina Promise 2022-10-26
    android - No builders are available to build a model of type 'org.jetbrains.plugins.gradle.model.internal.DummyModel'

    After upgrading Android Studio to 4.0 version and in "gradle-wrapper.properties" :

    distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip

    I am getting the following error in Android Studio while syncing: No builders are available to build a model of type 'org.jetbrains.plugins.gradle.model.internal.DummyModel'.

    and unable to create or run the app build.

    Margrit Simon 2022-11-21
    Read android's versionName from build.gradle in Jenkins pipeline

    I have a (Windows) Jenkins pipeline for my Android project and I'm trying to get the versionName defined in build.gradle file. According to https://stackoverflow.com/a/51067119/5973853 and https://stackoverflow.com/a/47437369/5973853 I have the setup below:

    build.gradle

    android {
      defaultConfig {
        versionCode 71
        versionName "2.3.0.Beta10"
      }
    }
    
    task versionName{
      doLast {
        println android.defaultConfig.versionName
      }
    }
    

    Jenkinsfile

    pipeline {
      environment {
        SERVER_PATH = '\\\\ARK_SRV\\Android\\'
      }
      agent any
    
      stages {
    
        stage('Create Directory') {
          steps {
            script {
              def VERSION_NAME = bat (script: "./gradlew -q versionName", returnStdout: true).trim()
              echo "Version Name: ${VERSION_NAME}"
              def FINAL_DIR = SERVER_PATH + VERSION_NAME
              echo "Final Directoy: ${FINAL_DIR}"
              // ...
            }
          }
        }
    
      }
    
    }
    

    However I'm getting both the whole batch command and its output into VERSION_NAME variable, so the printouts look like this:

    Actual Values

    Version Name: C:\Program Files (x86)\Jenkins\workspace\AndroidTest>./gradlew -q versionName 
    2.3.0.Beta10
    
    Final Directoy: \\ARK_SRV\Android\C:\Program Files (x86)\Jenkins\workspace\AndroidTest>./gradlew -q versionName 
    2.3.0.Beta10
    

    Expected Values

    Version Name: 2.3.0.Beta10
    
    Final Directoy: \\ARK_SRV\Android\2.3.0.Beta10
    

    What am I doing wrong? Is there a better way to retrieve defaultConfig values from my build.gradle?

    Filibert Nosizwe 2022-11-17
    android - How do I perform "Build/Refresh Linked C++ Projects" from command line?

    I have an Android/NDK application and a build script which uses gradlew.bat to automate build/install.

    The build.gradle uses CMakeLists.txt and GLOB_RECURSE internally in order to build the C++ files. However, if I add a new .cpp file to my C++ source code directory, I have to manually start Android Studio and run "Build/Refresh Linked C++ Projects", otherwise the buildscript will not pick up the added .cpp files and I get linker errors.

    I would like to have the buildscript to perform the "Refresh Linked C++ Projects" action, but I cannot find a Gradle task which performs this.

    Does anyone know how I can perform this action, with or without Gradle, from command line?

    Adrianne Siavash 2022-11-19
    android - Gradle build hanging when jackOptions is enabled for Java 1.8

    I want to use lambdas in my project so I decided to switch to Java 1.8. Android Studio (2.1.3) forced me to enable jackOptions. Also I did install Java 1.8 on my mac and when I run javac -version in terminal I get javac 1.8.0_101 and the JDK in android studio points to the right one.

    When I try to build my project, gradle gets stuck on: :app:compileDebugJavaWithJack

    I did the following and nothing worked:

    • gradlew clean
    • git clean -fdx and reimport the project
    • gradlew --stacktrace assemble

    If I revert back to Java 1.7 I lose the lambdas feature but project builds properly.

    Any ideas what could be the problem?

    UPDATE

    Ok so after waiting for more than 5 minutes finally gradle did spit the following error:

    ERROR: Dex writing phase: classes.dex has too many IDs. Try using multi-dex
    
    com.android.jack.api.v01.CompilationException: Dex writing phase: classes.dex has too many IDs. Try using multi-dex
            at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:113)
            at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1852)
            at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.java:1679)
            at com.android.build.gradle.internal.transforms.JackTransform.runJack(JackTransform.java:221)
            at com.android.build.gradle.internal.transforms.JackTransform.transform(JackTransform.java:195)
            at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
            at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
            at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
            at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
            at sun.reflect.GeneratedMethodAccessor412.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
            at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
            at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
            at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
            at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
            at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
            at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
            at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
            at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
            at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: com.android.jack.JackAbortException: Dex writing phase: classes.dex has too many IDs. Try using multi-dex
            at com.android.jack.backend.dex.DexFileWriter.run(DexFileWriter.java:90)
            at com.android.jack.backend.dex.DexFileWriter.run(DexFileWriter.java:41)
            at com.android.sched.scheduler.ScheduleInstance.runWithLog(ScheduleInstance.java:203)
            at com.android.sched.scheduler.MultiWorkersScheduleInstance$SequentialTask.process(MultiWorkersScheduleInstance.java:466)
            at com.android.sched.scheduler.MultiWorkersScheduleInstance$Worker.run(MultiWorkersScheduleInstance.java:163)
    Caused by: com.android.jack.backend.dex.DexWritingException: Dex writing phase: classes.dex has too many IDs. Try using multi-dex
            at com.android.jack.backend.dex.SingleDexWritingTool.write(SingleDexWritingTool.java:59)
            at com.android.jack.backend.dex.DexFileWriter.run(DexFileWriter.java:87)
            ... 4 more
    Caused by: com.android.jack.backend.dex.SingleDexOverflowException: classes.dex has too many IDs. Try using multi-dex
            ... 6 more
    Caused by: com.android.jack.tools.merger.MethodIdOverflowException: Method ID overflow when trying to merge dex files
            at com.android.jack.tools.merger.ConstantManager.addDexFile(ConstantManager.java:177)
            at com.android.jack.tools.merger.JackMerger.addDexFile(JackMerger.java:69)
            at com.android.jack.backend.dex.DexWritingTool.mergeDex(DexWritingTool.java:149)
            at com.android.jack.backend.dex.SingleDexWritingTool.write(SingleDexWritingTool.java:57)
            ... 5 more
    :app:transformJackWithJackForTabletsDebug FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:transformJackWithJackForTabletsDebug'.
    > com.android.build.api.transform.TransformException: com.android.jack.api.v01.CompilationException: Dex writing phase: classes.dex has too many IDs. Try using multi-dex
    

    So I did turn on multidex and it got stuck on Building 96% > :app:transformJackWithJackForTabletsDebug

    Markos Agatha 2022-12-03
    android - Specify different repositories when using Cordova gradle wrapper

    I'm using Cordova Android 4.0.0 which uses a gradle wrapper to build. I need to specify a different repository than mavenCentral. I can't simply modify the build.gradle file because it's auto-generated by Cordova. Because it's using the wrapper distribution specified by Cordova I can't add an /init.d to the distribution. I've tried adding a USER_HOME/.gradle/init.gradle file which doesn't seem to be getting used. Is there some other way to specify an init file when using a wrapper that I don't have control over?

    EDIT: As a workaround for now I've added an after_prepare hook that changes the text "mavenCentral()" found anywhere in the build.gradle files to the repo I need to use instead. There's got to be a better gradle based solution though...

    Noah Cas 2022-12-03
    java - Duplicate class error when i added facebook login and SDK dependencies

    I added "Login with facebook" feature on my app and also i added these 2 dependencies on my project:

    implementation 'com.facebook.android:facebook-login:5.15.3'
    implementation 'com.facebook.android:facebook-android-sdk:5.15
    

    The problem is whenever i try to run my app on my device i'm getting this error below:

    Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.customtabs.ICustomTabsCallback$Stub$Proxy found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.customtabs.ICustomTabsService found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.customtabs.ICustomTabsService$Stub found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.customtabs.ICustomTabsService$Stub$Proxy found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.customtabs.IPostMessageService found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.customtabs.IPostMessageService$Stub found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.customtabs.IPostMessageService$Stub$Proxy found in modules browser-1.0.0-runtime (androidx.browser:browser:1.0.0) and customtabs-27.0.2-runtime (com.android.support:customtabs:27.0.2)
    Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.0.2-runtime (com.android.support:support-compat:27.0.2)
    Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.0.2-runtime (com.android.support:support-compat:27.0.2)
    Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.0.2-runtime (com.android.support:support-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$CallbackHandler found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$ConnectionCallback found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$ConnectionCallback$ConnectionCallbackInternal found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$ConnectionCallback$StubApi21 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$CustomActionCallback found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$CustomActionResultReceiver found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$ItemCallback found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$ItemCallback$StubApi23 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$ItemReceiver found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImpl found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$1 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$2 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$3 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$4 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$5 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$6 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi21$7 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi23 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplApi26 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$1 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$2 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$3 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$4 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$5 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$6 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$MediaServiceConnection found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$MediaServiceConnection$1 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserImplBase$MediaServiceConnection$2 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaBrowserServiceCallbackImpl found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaItem found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaItem$1 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$MediaItem$Flags found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$SearchCallback found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$SearchResultReceiver found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$ServiceBinderWrapper found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.media.MediaBrowserCompat$Subscription found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.0.2-runtime (com.android.support:support-media-compat:27.0.2)
    Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.0.2-runtime (com.android.support:support-compat:27.0.2)
    
    Go to the documentation to learn how to Fix dependency resolution errors.
    

    My build.gradle file:

    plugins {
        id 'com.android.application'
        id 'com.google.gms.google-services'
    
    }
    
    android {
        compileSdkVersion 30
        buildToolsVersion "30.0.3"
    
        defaultConfig {
            applicationId "com.george.igrow"
            minSdkVersion 27
            targetSdkVersion 30
            versionCode 5
            versionName "0.5"
    
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }
    
    dependencies {
        implementation platform('com.google.firebase:firebase-bom:26.7.0')
        implementation 'com.facebook.android:facebook-login:5.15.3'
        //implementation 'com.facebook.android:facebook-android-sdk:5.15.3'
        implementation 'com.android.billingclient:billing:3.0.3'
        implementation 'com.daimajia.androidanimations:library:2.4@aar'
        implementation 'androidx.appcompat:appcompat:1.2.0'
        implementation 'com.google.android.material:material:1.3.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
        implementation 'com.google.firebase:firebase-auth:20.0.4'
        implementation 'org.jetbrains:annotations:15.0'
        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
        implementation 'com.google.firebase:firebase-database:19.7.0'
        implementation 'com.google.android.gms:play-services-auth:19.0.0'
        testImplementation 'junit:junit:4.13.2'
        androidTestImplementation 'androidx.test.ext:junit:1.1.2'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    }
    

    I try to remove the 2 dependencies and then i'm getting other errors

    NOTE: I have androidx on my project

    Simon Yitro 2022-12-06