I updated my Android Studio to Android Studio 3.4 and I'm trying to run one of my apps but it gives me an error.
com.android.tools.idea.run.ApkProvisionException: No outputs for the main artifact of variant: debug
Session 'app': Install failed.
Installation failed
Rerun
Solved it by going to Run => Edit Configuration => app (or your project name)
In the Before Launch section, I added Gradle-aware Make.
The hint came from comparing my project with the example screenshot available at https://developer.android.com/studio/run/rundebugconfig#opening
Try running your app after reloading your gradle project
Right click over your project under Gradle tab
You may be using an incompatible Gradle and Android Gradle plugin version.
Upgrade Gradle to version 4.1 at least
in gradle/wrapper/gradle-wrapper.properties
use:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
and in root build.gradle
modify the following lines (add Google maven repository and update plugin to 3.0.1):
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
I had the same problem.
On the left there is a pane where all the files are displayed called "Build Variants"
I selected that and my main app module was set to debug-x86. I changed that to debug-x86-64 and it worked]1
In my case, delete Signed Bundle files you were created.
Related
I'm installed Android Studio 3.5 and started to use it with my old project (gradle 2.14 and I want save this version).
Build in debug and release mode work fine. But when I try generate signed APK an error message are appeared:
"The project is using an unsupported version of Gradle.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)"
How it can be? Why I can't just asign APK?
I'm downgrade to Android Studio 3.4.1 and signing worked fine.
Please make a change in the last line as follows:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
and try to Rebuild your project again.
In your project inside gradle-wrapper.properties file.
Change this line..
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
In your project level build.gradle..
buildscript {
repositories {
jcenter() // or mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0' // change to this version
}
}
The latest version of gradle is 3.1 enter link description here
but Android Studio is only using 2.2?
enter link description here
This seems likes a huge discrepancy. My configuration:
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2'
classpath 'de.felixschulze.gradle:gradle-hockeyapp-plugin:3.2'
classpath 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
}
}
allprojects {
repositories {
jcenter()
}
}
When I try to find gradle 3.1, I get an error that it cannot find it. Same now with 2.2 > Could not find com.android.tools.build:gradle:2.2.
But gradle -v shows
gradle -v
------------------------------------------------------------
Gradle 2.2
how do I resolve this?
You are confusing Gradle with the Android gradle plugin, which generally matches the version of Android Studio. The latest version (at time of writing) is 2.2.2. It is generally set in your project's base build.gradle as you have shown above.
The Gradle wrapper is what you're looking for. You can change the wrapper's settings in your project's gradle/wrapper/gradle-wrapper.properties file.
Change
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip
Again, this is separate from the Android gradle plugin, which simply marries Gradle with Android Studio.
Find all distributions here
Here is the Gradle Version Compatibility for Android Studio
Gradle
refer to link
A problem occurred research project ': sample'.
Failed to apply plugin [id 'com.android.application']
Minimum supported Gradle version is 3.3. Current version is 3.2.1.
The current gradle configuration is also changed to 3.3. The project is running without problems, but can not use the command line (gradle and ./gradlew).
Refer to the online program:
1. Modify gradle-wrapper.properties, and Invalidate Caches / Restart ..., or do not work.
Later in the gradle forum to find a program: Thank you Henry
As new release with the fix not available yet, the former walk-around works fine.
Buildscript {
System.properties ['com.android.build.gradle.overrideVersionCheck'] = 'true'
...
}
. So mark what.
Correction statement : I later found that I installed the sdkman tool,
the tool installed 3.2.1 version, and this should be related (⊙ o ⊙)!
. At the beginning of the show gradle version, will show 3.2.1
version (I am still very depressed, change or show 3.2.1), I have
changed to the environment variable 3.3. I set the gradle environment
variable first, the following is set sdkman environment variable (this
order may also affect). So the final reason is still installed 3.2.1
version.
When i try to start an old App with the InstantRun it says that:
Gradle build-info.xml not found for module app. Please make sure that you are using gradle plugin '2.0.0-alpha4' or higher.
How can i solve this?
With the recent release of Android Studio 2.0, there is a new Android gradle plugin 2.0.0. You can apply that in your top-level build.gradle buildscript block by changing the version of the plugin to look like this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
}
}
EDIT: Some projects that were previously managed by Android Studio 1.5 may exhibit strange problems like this. To clear these problems, it may be required to delete the project's .idea directory and re-import it into AS 2.0.
It happend after updated to Studio 2.0,
I disable Instant Run function fix this issue
Update
After I upgrade android studio to version 2.1.1, enable instant run function. it works
Update2
It seems when I build release version, enable instant run is OK, not for debug version build. so strange.
I've just updated to Android Studio 1.3, opened an existing project I was working on, tried to run it. Gradle just gets stuck at the "Resolve dependencies':app_debugCompile'", I tried to wait, I waited for over an hour and nothing happened.
How can I solve it to get my app running?
If you are using proxy, it seems https proxy server setting is not correctly done in Android studio 1.3.
You can set https proxy server manually in gradle.properties,
systemProp.https.proxyHost=proxy.server.address
systemProp.https.proxyPort=8080
see Gradle Sync fails in Android studio 1.3 and gradle behind proxy in Android Studio 1.3.
How can I solve it to get my app running?
Start by identifying the problem more precisely. To do so, run gradle from the command line in the root directory of your project :
./gradlew --debug clean build
The --debug argument will simply enable the debug log level and hopefully providing useful information to understand where/why it is hanging.
I face this problem in linux and my problem solved after installing these dependencies on fedora :
sudo dnf install glibc.i686 zlib.i686 libstdc++-devel.i686
I had this problem.Just see this page. Solution is here
Solution :
Make sure you have latest stable version ( current 2.0.0 )
Make sure your gradle version is 2.0.0 in build.gradle ( classpath 'com.android.tools.build:gradle:2.0.0')
Final step and most important one is change your jcenter() to mavenCentral()
So you can easily add new dependency and sync project under 3sec !
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Go to app > Right Click on it > Open Module Settings>Change build tool version to 22.0.1
Try again after restarting your Android Studio
I've just encountered this issue in the OP, in my case it was taking over 20min just to get gradle build going. Getting stuck at the "Resolve dependencies':app_debugCompile'" as well.
I'm still relatively new to Stackoverflow so I can't up-vote yet. But what I can tell you is that if your behind a web proxy like I am and you've just updated to Android 1.3.1 you will probably notice this issue immediately. I already had my companies web proxy in the IDE settngs and yes there is something not ok with the 1.3.1 update. As corochann posted you have to add the proxy info to the gradle.properties of your project. Once I actually did this I noticed the difference immediately. Going forward until its resolved you'll probably have to add this to each project if your behind a web proxy and running 1.3.1. I have another machine at home that isn't behind a proxy and is running Android Studio version before 1.3.0 and had no issues. Hope this helps!!
I am working on an Android Project for few months and I recently upgraded android studio form 0.5.2 to 0.8.0. Now I am unable to open my project via new Android Studio. I am getting this error whenever I try to open the project and unable to open it.
The project is using an unsupported version of the Android Gradle plug-in (0.9.2)
Consult IDE log for more details (Help | Show Log)
I don't know much about Gradle, Ant, Maven or any built script. Also, there is no option to see the the logs from the Start screen of android studio.
Since your project is not being opened by the IDE, try to update Gradle plugin version manually. Locate build.gradle file in your project's root directory and change the version in buildscript block so it would look like this:
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
Save the file and try to re-open your project.
In Android Studio 0.8.7, you can change to
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}