Android Gradle build-info.xml not found - android

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.

Related

How to downgrade android gradle?

Since I update android gradle I have issues in my ringtone app, problem is in copying files and permissions I guess (I noticed that in manifest android.permission.WRITE_SETTINGS is underlined with red color, and I guess there is the problem)
Same code works perfectly in my old projects and the only difference is in gradle, so I tried some tutorials on net on how to downgrade it, but I have failed.
I tried in gradle-wrapper.properties(Gradle Version) to change
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
to the version that worked for me before, but I got message that 4.4 is minimum
then i tried to downgrade in build.gradle(Project)
but only succeeded to downgrade it to
classpath 'com.android.tools.build:gradle:3.0.1'
but that didn't solved my problem, because the working version was 2.3.3
with distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
and when I tried to sync with 2.3.3 i got error
Gradle DSL method not found: 'google()'
Possible causes:<ul><li>The project 'MyProject' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.1.4 and sync project</li><li>The project 'MyProject' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file</li><li>The build file may be missing a Gradle plugin.
Apply Gradle plugin</li>
Can somebody tell me the proper way and step by step solution to my problem
Below are the steps you may try but this is not a good way of solving the problem. You better focus on the main issue and try to solve it. Start from here or find other workarounds.
1-Remove google() from build.gradle and add maven instead:(for Gradle lower than 4.1)
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
}
}
2-Go to gradle-wrapper.properties and change gradle version to:
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
3-Change gradle plugin to(if you're using Android Studio 2.x.x):
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
4-Sync.

Old version of gradle is required error

I had a three year old Android Studio which I just upgraded to the latest version(3.2).
I opened a project and tried to run it, but I got this error:
Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.
Then, I saw this in gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip
From what I understand Gradle 2.2 is not compatible with Android Studio 3.2.
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
Now however, if I try building again, I get this error:
Gradle version 2.2 is required. Current version is 4.9.
Why does it ask me for an old version of Gradle?
There are TWO places to be aware of:
Android Gradle Plugin version.
Android wrapper version and Gradle version
Each version of Android Gradle Plugin version requires a minimum version of gradle version. For your case, it looks these two versions are not in sync. So, try to modify your files as below:
Top level build.gradle
buildscript {
repositories {
...
}
dependencies {
// This is the Android Gradle Plugin version
classpath 'com.android.tools.build:gradle:3.1.3'
}
}
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
Android studio doesn't support that version unfortunately. My advice is using 4.4, that's last full supported version.

Basic android studio project with errors

I just downloaded the Android 3.1 and I created a new project with a Basic Activity, but it doesn't recognize the Theme and other things, never happen before and sometimes some new activities comes with no ActionBar, its like transparent.
And
Any thoughts ? Thanks!
Gradle App level
Gradle project Level the same version of the Android Studio
I face this error often, that is actually an issue in AS. Your project will still run, and successful build.
This is just a editor error.
To resolve this
update your version of com.android.support libraries in app level build.gradle.
And gradle plugin version as same as your Android studio version in your project level build.gradle.
Update compileSdkVersion and buildToolVersion (or you can remove in with latest gradle version) to latest.
like i have 3.1.2 version of Android studio so i have
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
...
}
}
Clean, Rebuild and Enjoy.

Could not find gradle 3.1

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.

Fix Plugin Version and Sync Project

I have recently updated my Android Studio.
After updating it, When I am trying to import or open a project it gives me following error :
Gradle Sync Issue
Error:Error:Gradle 2.4 requires Android Gradle plugin 1.2.0 (or newer) but project is using version 1.1.0.
Please use Android Gradle plugin 1.2.0 or newer.
Fix plugin version and sync project
Is there any solution for this problem ?
In your build.gradle you should use a newer version of the gradle plugin.
Use classpath 'com.android.tools.build:gradle:1.3.1'instead of classpath 'com.android.tools.build:gradle:1.1.0'. Or at least 1.2.0, as the error points out.
change in your progect build.gradle file
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
As Android Studio was just officially updated to 1.3 (Gradle as well).
Please Change gradle version to 1.3.+ in build.gradle . It should now look like this:
dependencies {
classpath 'com.android.tools.build:gradle:1.3.+'
// in the individual module build.gradle files
}
I met this question,too. Modifying dependencies stuff is confuse me. From#Mykaelos answer, For Windows Android Studio, Go into File > Settings > "Build, Execution, Deployment" > "Build Tools" > Gradle and change it to "Use default gradle wrapper (recommended)", I tried it in early hours, and it works for me.

Categories

Resources