Android Studio edit UI failure

… or not, regarding many times in this forums you say some on new versions broke some on Fire. The right way to go must be tell which is the compatible version fo the UI editors used for Fire IMHO.

Best regards.

Also, and finally, FTR, this is the build.gradle I gust grabbed from a fresh project created by Android Studio:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.mh.myapplication"
        minSdkVersion 15
        targetSdkVersion 28
        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:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

so the implementation fileTree(dir: 'libs', include: ['*.jar']) is entirely correct, and should be there.

FTR.

Installed then same version you have.

Create a new android application.

Same error;

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

Trying to edit is unavailable until the project sync ok

K, that’s “good” as in that it’s not a change between AS versions. I still have no idea what causes the error but, as suggested before, maybe one of the dozens of Google hits for the same error (which right there tells you it’s not Elements-specific, as else no one using just AS would talk about it) have some insight — i don’t know.

I’m going to dig into this here locally once ADS ever finishes installing. Curious how they manage to break this every time :frowning:

In build.gradle change:

    classpath 'com.android.tools.build:gradle:2.3.0'

to:

    classpath 'com.android.tools.build:gradle:3.4.0'

and add google() to the repositories.
full file:

// 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.4.0'

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

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

that fixes it for me (seems Android studio doesn’t support the older version anymore). I’ll fix the code to do this automatically and will test more extensively when I have a new build.

@DonaldShimoda can you let me know if this works for you and/or if you need a new build?

It works quite well for me.

Thanks Carlo.

This is my complete file

apply plugin: 'com.android.application'

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'

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

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

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]'
}

please tell me if I understand you ok or not, because I now get this error

ERROR: Cannot add task ‘clean’ as a task with that name already exists.

if I remove task clean I get the same previous error

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

also test on a new clean project with this fiel and get the same errors

apply plugin: 'com.android.application'

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'

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

allprojects {
    repositories {
        jcenter()
        google()
    }
}

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.androidapplication5"
        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'])

}

Any chance you can send the project or a narrowed down version of the project so I can see it here. Above works for me.

Sure, thanks in advance!

Thanks, logged as bugs://82557

This is what I get for your project:

(Looks quite good)

Looking at those files; there are TWO build .gradles; I think that’s where that goes wrong. The latest code puts this in the root build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'

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

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

and this in app/build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.androidapplication5"
        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'])

}

bugs://82557 got closed with status fixed.

Carlo,
The project was NEW.

Fire,
New project
Android

Build

Edit Ui.

That is what you see… I dont add any grade file at all…

If theres TWO grade files was created for Fire or for Android Studio. In any case I believe FIRE must try to solve this or add instructions on the help to the fuser to manually solve that error.

Best regards.

Yes. Thats my point though, what I fixed should have fixed this whole thing… I did get the exact error you got, and when I fixed it I didn’t (with latest Android Studio). Canyou see if today’s release works for you?

1 Like

Thanks Carlo, will wait the upcoming Fire release and tell you.

Best regards!

Sorry for the very very late response. That work as expected on my new fresh install with case insensitive file system.

Best regards.

2 Likes