question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR: Could not find method android()

See original GitHub issue

can’t build the application on android studio

        android {
            buildToolsVersion '28.0.0'
            compileSdkVersion rootProject.ext.compileSdkVersion
            buildToolsVersion rootProject.ext.buildToolsVersion
            defaultConfig {
                minSdkVersion rootProject.ext.minSdkVersion
                targetSdkVersion rootProject.ext.targetSdkVersion
            }

Environment

  • Async Storage version:
  • React-Native version:
  • Platform tested:
  • Logs/Error that are relevant:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
krizzucommented, Feb 10, 2020

@HelSirius Right, so in your root build.gradle you have subprojects { afterEvaluate { } } configurations. This goes through all modules that are added to your project, including AsyncStorage.

If Async Storage is used a module (in your case, it is) it does not include android plugin, hence no android block is available.

To fix that, add a check if android block exists:

subprojects{
    afterEvaluate {
        // check if `android` block is available
        if(it.hasProperty('android')){
            android {
               // your content here
            }
        }
    }
}
1reaction
ghostcommented, Feb 18, 2020

@tido64 Yes I did and thank you @Krizzu

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find method android() for arguments - Stack Overflow
I have an old Eclipse project automatically imported into AS 2.2.2. It's reporting that same error but in the build.graddle file inside the...
Read more >
Fix "Error Could not find method implementation() for ...
Method 1: Update to the latest Gradle version ... In case you are using the “implementation” configuration in an older version of Gradle,...
Read more >
How to solve Android error: Could not find method ...
In this article I will explain to you possible solutions to this problem in Android Studio.
Read more >
Could not find method android() for arguments - Ionic Forum
In android studio, when trying to “run” a project created by “ionic cap build android”, I received the following error:
Read more >
Error Could not find method implementation for arguments
Error:(74, 1) A problem occurred evaluating project ':app'. > Could not find method implementation() for arguments [com.android.support: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found