Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update project to latest android studio : Gradle DSL method not found: 'deleteAllActions() #54

Open
VivekAgar opened this issue Feb 14, 2020 · 9 comments

Comments

@VivekAgar
Copy link

When i updated my fireApp builder project to latest android studio getting errors :
`FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':ContentBrowser'.

org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method deleteAllActions() for arguments [] on task ':ContentBrowser:extractDebugAnnotations' of type com.android.build.gradle.tasks.ExtractAnnotations.

  • 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

CONFIGURE FAILED in 30s
Gradle DSL method not found: 'deleteAllActions()'
**Below is contents of my app-level build.gradle**/**

  • Copyright 2015-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • A copy of the License is located at
  • http://aws.amazon.com/apache2.0/
    
  • or in the "license" file accompanying this file. This file is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  • express or implied. See the License for the specific language governing
  • permissions and limitations under the License.
    */
    apply plugin: 'com.android.application'
    //apply plugin: 'me.tatarka.retrolambda'
    // Uncomment when using CrashlyticsComponent
    //apply plugin: 'io.fabric'
    apply from: "../artifacts.gradle"

repositories {
// Uncomment when using CrashlyticsComponent
//maven { url 'https://maven.fabric.io/public' }
//jcenter()
//google()
}

buildscript {
repositories {
jcenter()
// Uncomment when using CrashlyticsComponent
//maven { url 'https://maven.fabric.io/public' }
//google()
}
dependencies {
//classpath 'me.tatarka:gradle-retrolambda:3.2.3'
// Uncomment when using CrashlyticsComponent
//classpath 'io.fabric.tools:gradle:1.+'
}
}

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
    applicationId "com.mycompany.firetv.myapp"
    minSdkVersion 21
    targetSdkVersion 26
    versionCode 6
    //versionCode 5
    //versionName "1.3"
    versionName "1.4"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        testCoverageEnabled = true
    }
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

// this is for jackson
packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
    exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
    exclude 'META-INF/rxjava.properties'
}

lintOptions {
    abortOnError false
}

}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'org.mockito:mockito-core:1.9.5'
androidTestCompile ('com.android.support.test:rules:0.5') {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile ('com.android.support.test:runner:0.5') {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'

androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.3.1'

compile project(':TVUIComponent')
compile project(':UAMP')
compile project(':AMZNMediaPlayerComponent')
compile project(':PassThroughAdsComponent')
compile project(':PassThroughLoginComponent')
compile project(':LoggerAnalyticsComponent')

}`

and Application level build.gradle

`ext {
var = '3.5.0'
} /**

  • Copyright 2015-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • A copy of the License is located at
  • http://aws.amazon.com/apache2.0/
    
  • or in the "license" file accompanying this file. This file is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  • express or implied. See the License for the specific language governing
  • permissions and limitations under the License.
    */
    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
google()
//mavenCentral()
}
dependencies {
//classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.5.3'

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

}

allprojects {
repositories {
jcenter()
google()
mavenCentral()
if (rootProject.hasProperty('mavenUrl')) {
maven { url rootProject.mavenUrl }
}
}
}`

Additional info :
My Android studio version is 3.5.3
Gradle distribution URL is :
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
it looks like we can't update this repo to latest android studio and gradle version.

@levonlevonian
Copy link

Hi Vivek,

It's a Gradle configuration error, and not Fire App Builder error. Please see the following thread discussing that issue: #14

@VivekAgar
Copy link
Author

Hi,
Thanks for suggestion, I tried all solutions mentioned in #14
I had to downgrade my android studio and Gradle versions to run it smoothly. I was able to build apk with Android studio 3.1.1 and Gradle tool 2.3.0+ and Gradle distribution jar -4.6-all.

@levonlevonian
Copy link

Thanks for the update Vivek,

As far as I know it might be an issue with either the different version of build tools or configuration. I am glad you are able to build your app now. Thanks!

@tmm1
Copy link

tmm1 commented May 28, 2020

I can confirm that after applying this patch to update gradle:

diff --git a/Application/artifacts.gradle b/Application/artifacts.gradle
index 2831c22..0c7a934 100644
--- a/Application/artifacts.gradle
+++ b/Application/artifacts.gradle
@@ -8,7 +8,7 @@ android.applicationVariants.all { variant ->
         appName = parent.name
     }

-    variant.outputs.each { output ->
+    variant.outputs.all { output ->
         ;
         def newApkName
         if (output.zipAlign) {
@@ -16,6 +16,6 @@ android.applicationVariants.all { variant ->
         } else {
             newApkName = "${appName}-${output.baseName}-${variant.versionName}-unaligned.apk"
         }
-        output.outputFile = new File(output.outputFile.parent, newApkName)
+        output.outputFileName = new File(output.outputFileName, newApkName)
     }
 }
diff --git a/Application/build.gradle b/Application/build.gradle
index 4ad3204..1704f4a 100644
--- a/Application/build.gradle
+++ b/Application/build.gradle
@@ -18,9 +18,10 @@ buildscript {
     repositories {
         mavenCentral()
         jcenter()
+        google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.2.3'
+        classpath 'com.android.tools.build:gradle:4.0.0'

         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
diff --git a/Application/gradle/wrapper/gradle-wrapper.properties b/Application/gradle/wrapper/gradle-wrapper.properties
index 9f0b201..2a1c497 100644
--- a/Application/gradle/wrapper/gradle-wrapper.properties
+++ b/Application/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Sep 21 14:11:34 PDT 2015
+#Thu May 28 14:37:40 PDT 2020
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

the following error is produced by Android Studio:

Gradle sync failed: Could not find method deleteAllActions() for arguments [] on task ':ContentBrowser:extractDebugAnnotations' of type com.android.build.gradle.tasks.ExtractAnnotations.

@levonlevonian
Copy link

If you are building with Java 8, and also using RetroLambda in your project, then please remove retrolambda in gradle.properties file, because Java 8 supports lambda expressions.

@tmm1
Copy link

tmm1 commented Jun 4, 2020

After removing retrolambda:


FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:Script '/Users/tmm1/fancybits/fire-app-builder/TVUIComponent/config/quality.gradle' line: 2

* What went wrong:A problem occurred evaluating script.
> Plugin with id 'findbugs' not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------* What went wrong:A problem occurred configuring project ':TVUIComponent'.
> compileSdkVersion is not specified. Please add it to build.gradle

* 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

BUILD FAILED in 682ms

@tmm1
Copy link

tmm1 commented Jun 4, 2020

After removing findbugs:

> Task :AdsInterface:extractDebugAnnotations FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':AdsInterface:extractDebugAnnotations'.
> Could not resolve all files for configuration ':AdsInterface:lintClassPath'.
   > Could not find com.android.tools.lint:lint-gradle:27.0.0.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/27.0.0/lint-gradle-27.0.0.pom
       - https://repo.maven.apache.org/maven2/com/android/tools/lint/lint-gradle/27.0.0/lint-gradle-27.0.0.pom
     Required by:
         project :AdsInterface

* 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

BUILD FAILED in 5s

Seems like a never ending list of warnings and errors. It is not reasonable to expect every user to figure this out themselves just because they are using a recent version of Android Studio.

It seems clear this project had been abandoned by Amazon, and at the very least the README should be updated to state that no updates are happening and it only works with Android Studio 2.x

@levonlevonian
Copy link

Some things to check:
Are you using Java 8?
Are you using Android support library? Normally, if you have something like:
implementation 'com.android.support:appcompat-v7:27.+'
then you'd need to make sure you that in build.gradle(app) you set the sdk version to the same value (in this case, 27) for both compileSdkVersion and targetSdkVersion, otherwise your project would not know for which platform it should be built.
Are you using Gradle 6? If so, then the Gradle web site says (in Upgrading your build from Gradle 5.x to 6.0):
The FindBugs plugin has been removed
The deprecated FindBugs plugin has been removed. As an alternative, you can use the SpotBugs plugin from the Gradle Plugin Portal.

@tmm1
Copy link

tmm1 commented Jun 4, 2020

I am giving up but if someone else wants to try: master...tmm1:build-fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants