Android Studio edit UI failure

Fire 2401

Fire -> Edit user interface files

Open android studio, start working and raise that error:

ERROR: Could not find method implementation() for arguments [directory ‘libs’] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

build.gradle File content

apply plugin: 'com.android.application'
android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.example"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

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

    implementation 'com.android.support:appcompat-v7:25.2.0'

    implementation 'com.android.support:support-fragment:*'

    implementation 'com.google.android.gms:play-services-gcm:[15.0.1]'

    implementation 'com.google.android.gms:play-services-maps:[15.0.1]'

    implementation 'com.google.android.gms:play-services-location:[15.0.1]'

    implementation 'com.google.android.gms:play-services-auth:[16.0.1]'
}

close all, clean obj folder, retry. Same situation.

Is this specific to this one project?

No, I create a new empty android application and raise same error

apply plugin: ‘com.android.application’

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.androidapplication4"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

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

}

Hm, then I don’t know. that worked fine for me last week.

From the error message, this does not seem to be related to something we generate:

ERROR: Could not find method implementation() for arguments [directory ‘libs’] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

But the interwebs seem to have thoughts on the issue: http://bfy.tw/NYOk

I understand Android ecosystem is complex (and very buggy).
Maybe can help if you publish in the release notes what version are you using of android studio for testing Fire?
I don’t know how to solve that kind of rocks in the road, and every time i get an android project to work with fire I hit one.
Maybe if theres an android studio version, and gradle version tested with Fire (certified or whatever it can be called) can we minimize this recursive problem?

Just an idea.

Best regards.

Thanks.

As I say:

compile was recently [deprecated](https://www.youtube.com/watch?v=7ll-rkLCtyk&feature=youtu.be&t=29m18s) and replaced byimplementationorapi

That file is generated for android studio or Fire?

Solved, have to remove by hand

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

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

}

That file is generated by android studio? Cant be generated in the right way for fire?

Best regards

Fire. Bit it already says implementation, so you have the fixed version, no? Besides, this was only a warning, with compile, not a fatal error.

removed what by hand?

I tested this just last week with the latest Android Studio, when I made the changes for implementation instead of compile. So this is the right way, assuming Google didn’t release an update top Android Studio that broke this within the past 7 days…

The part I show in my post (?)

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

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

I don’t know what to say then. The file is bad formatted to work with the android studio version I show at the first post, need the project to check yourself? Or what are we discussing?

The only issue I can reproduce is that hitting build in Android Studio doesn’t seem to like the * version number, or []. fixing those, all errors are gone. I cannot see either affecting the ability to open the designer though, it opens fine for me even without fixing these.

What are your except steps for seeing the “ERROR: Could not find method implementation()”, and what is it actually preventing you from doing – keeping in mind that the Android Studio project is not supposed to *build, its just there as a shell so you can launch the designers when you don’t want to manually code the XML…

Also, your Android Studio version is far from being recent. This is what I have, and its even offering me an update, right now:

That one’s fixed for vNext.

I can’t open the designer at all, that is the Android studio status right now, dont touch anything yet.

Will update then, that is what im asking for.


(those are two random packages from the project I happened to be using; a fresh project from templates would not have any gradle references, and thus not even bit the thing I fixed above.

Update dont work at all. Will proceed to Android studio fresh install

:woman_shrugging:t3::woman_shrugging:t3:

As I say, will be great if Fire release notes include the Android studio compatible version with Fire to avoid all that lack of time for both next time.

Will install android 3.4 fresh and tell you what happens.

Best regards

We cannot test Elements (also, just for the record, m not of tis has anything to do with Fire, really) against every single version of Android Studio. These tools update and evolve too often. But as a general rule of thumb, not using a version over half a year old is a good start.