I am running Android Studio 3.4.1 and I'm trying to build a bundle.
Build -> Build Bundle(s) / APK(s) -> Build Bundle(s)
And here is what I see:
When I click Update, the dialog dismisses and absolutely nothing happens. I have tried several times.
I also have this:
I am very new to Android Studio, but my simple app is complete and ready to deploy to the Google Play Store. Is there some alternate way to build a bundle? Am I missing something?
First make sure in your current plugin google() is included.
buildscript {
repositories {
// Gradle 4.1 and higher include support for Google's Maven repo using
// the google() method. And you need to include this repo to download
// Android Gradle plugin 3.0.0 or higher.
google()
...
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
}
}
Second - Update values in distributionURL gradle-wrapper.properties and sync
distributionUrl = https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl path could be found at following path
Related
Generate Signed APK not active in build menu android studio!
The problem is happened because you're using an incorrect version of Android Gradle plugin. There is no version 3.2.1 yet. So, change your project/root build.gradle with version 3.2.0 (take a look Android Gradle plugin release notes for more details):
buildscript {
repositories {
google()
...
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
}
}
Then sync your project after the changes.
Make sure that your project build without any error. And Whenever you open Project Level Gradle then Generate Signed Apk , Select Build Variant Options are not available.
I have a project loaded in Android Studio 3.0. Gradle sync works fine, and the project builds.
When I add implementation 'com.amazonaws.aws-android-sdk-mobile-client:2.6.+' to my build.gradle (Module:app) file, right next to all the other dependencies that are already part of this fine project, gradle fails to find that dependency. Many of the existing project dependencies are under com.amazonaws.aws-android-sdk-* and are being sync'ed just fine, for e.g. implementation 'com.amazonaws:aws-android-sdk-core:2.6.+' is fine.
So I double check that new project dependency actually exists, browsing http://repo.maven.apache.org/maven2/com/amazonaws/aws-android-sdk-mobile-client shows it exists, I don't see a typo.
Looking at my build.gradle (Project: myProject), I see the following
allprojects {
repositories {
mavenCentral()
google()
jcenter()
}
}
Yet when gradle syncs i get
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.amazonaws.aws-android-sdk-mobile-client:2.6.+:.
Could not resolve com.amazonaws.aws-android-sdk-mobile-client:2.6.+:.
Required by:
project :app
No cached version of com.amazonaws.aws-android-sdk-mobile-client:2.6.+: available for offline mode.`
There is a typo in your dependency.
Use
implementation 'com.amazonaws:aws-android-sdk-mobile-client:2.6.+'
instead of
implementation 'com.amazonaws.aws-android-sdk-mobile-client:2.6.+'
uncheck "Offline Work" in Android Studio / File / Settings / Build, Execution, Deployment / Gradle
Trying to start a new Kotlin project with Android Studio 3.0 Canary 1 displays this error. Full trace:
Error:Unable to find method
'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'.
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.
I've tried the first two options and the third-party plugins are left as default.
gradle-wrapper.properties
#Thu May 18 08:36:52 BST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.2-3'
repositories {
maven { url 'https://maven.google.com' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I haven't touched any of these values myself, they're left as default. Creating a non-Kotlin new project does not have this problem.
In my build.gradle changing
ext.kotlin_version = '1.1.2-3'
to
ext.kotlin_version = '1.1.2-4'
fixed this.
You can find the most recent version here.
It worked for me
Using the 8.4.0 version
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
For Java
Just remove
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
downgrade butterknifeversion to 8.4.0
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
Don't forget to remove
apply plugin: 'me.tatarka.retrolambda'
from app level build gradle.
This is a known issue in Android Studio Preview 3.0:
If you see this error, it's possible you have a pre-existing version of the Kotlin plugin that is incompatible with the new Android Plugin for Gradle that's in Android Studio 3.0. The solution is to delete the old Kotlin plugin.
Open your project-level build.gradle file and locate ext.kotlin_version. It should be 1.1.2-4 (or higher). If it shows an older version, you need to delete the old Kotlin plugin so it does not obstruct the version included with Android Studio 3.0.
On Windows, it should be located at
C:\Users\user_name\AndroidStudio_version\config\plugins\Kotlin\
On Mac, look in
~/Library/Application\ Support/AndroidStudio_version/Kotlin/
In my case, the issue was caused because we were applying butterknife-gradle-plugin. Upgrading to 8.8.1 didn't fix the issue, but removing it certainly did.
The build.gradle belongs to the application, so I don't even know why we are using that plugin (I'm new to the project)
Update your kotlin version to the latest:
ext.kotlin_version = '1.1.2-4' //currently it's the latest version
Then you may face some more errors, so before syncing again, make sure that your buildToolsVersion is "26.0.2" or higher.
I recently updated Android Studio from version 2.1 to 2.2 and my previously working project has major build errors, centering around a "gradle failed to sync" message I got when opening the project for the first time in version 2.2
It seems that some update occurred to gradle when I did the Studio upgrade to version 2.2, and this update has broken my old project's references (I think). All editing/debugging/simulation features aren't usable within Android Studio when I open this project. What did I do wrong when upgrading, and more importantly how can I fix my broken project and restore full Android Studio functionality while editing this project like I had when running version 2.1.
In the image below you will notice i'm getting a message about a VCS root misconfiguration and all of my toolbar buttons (run, debug, etc) are grayed out.
What can I do to fix this?
I've included my build.gradle file below
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
allprojects {
repositories {
jcenter()
}
}
Same configuration should work.
click on configure VCS(the popup in right side).And to enable Run, Debug etc options, select module(android app module)to run from dropdown option(in left of run option).
For Instant Run to work , update Gradle to 2.2.0-beta3 or higher.
This project has been working for weeks. Yesterday, Android Studio pulled in some updates, and now gradle cannot find my play-services files. It has literally stopped building with no changes to the project - I didn't think this would happen with a gradle-based project.
gradle sync error
When I click on "Install Repository and sync project", another window opens with the message:
Ignoring unknown package filter 'extra-google-m2repository'Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
Here is my gradle file:
apply plugin: 'android-library'
repositories {
mavenCentral()
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:20.0.+'
compile 'com.android.support:support-v4:20.0.+'
compile 'com.google.android.gms:play-services-games:6.5+'
compile 'com.google.android.gms:play-services-plus:6.5+'
compile 'com.google.android.gms:play-services-appstate:6.5+'
}
android {
compileSdkVersion 20
buildToolsVersion '20'
}
Looking in my SDK manager, both "Google Repository" and "Android Support Repository" are installed.
SDK manager screen shot
It is possible that I have two different SDK's, but not sure how to tell if I do, and not sure how to remove the extra one if this is the issue.
Removing the "+" and specifying the specific version allows me to build again. I'm actually using 6.5.87, as 8.4.0 caused some other issue.