After gradle update to 2.10, can't run app - android

I'm running on Android Studio 2.1.1 and was recently asked to update the gradle plugin to 2.10 (form 2.2.1) to have the ability of instant runs, which needles to say I did.
Right after that only one particular project can't build and I've tried everything that's available on the subject as question on stackoverflow.
Here are my settings
project build.gradle:
gradle/gradle-wrapper.properties:
After I try to run I get the following:
via terminal
gradle clean --stacktrace
The last thing is pretty strange since I've set the version to 2.10
Any ideas?

I did my search too on this.Some said to delete the file manually but it gave me a new file everytime i did that.Try reimporting your project and rebuilding it.

Related

Cannot build or run in android studio

I was using android studio 4.1.1, I updated to the 4.1.3 version and after that I had some problems.
Gradle sync never finished.
the android view (top right) is not showing properly. it appears just like the project view
The buttons for build, make project and run are not working
I have errors all around the code.
What I have tried:
I tried to upgrade the Gradle to the latest version. but nothing worked
I went to File>Invalidate Caches/Restart. but it did not work
I wanted to Sync project with Gradle files. but that options is not even available (I guess it is due to the Gradle sync still in progress)
I cannot acces the project structure in File>Project Structure (it shows me the error in the snapshot below)
I have been stuck for two days now, and cannot proceed with coding. If anyone can help, I will gladly provide any further information you will need.

No builders are available to build a model of type 'org.jetbrains.plugins.gradle.model.internal.DummyModel'

After upgrading Android Studio to 4.0 version and in "gradle-wrapper.properties" :
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
I am getting the following error in Android Studio while syncing:
No builders are available to build a model of type 'org.jetbrains.plugins.gradle.model.internal.DummyModel'.
and unable to create or run the app build.
This can be one solution. I tried Copy and Cut everything in the setting.gradle file located in the project directory then SYNC project after Gradle is complete. Later paste the content back to the file and SYNC again. This not worked for me but for others, it worked.
Another solution is to downgrade the android studio to v 3.6.3 download by clicking here. You can follow these steps to downgrade the android studio. This solution worked for me and now I can build and run the application successfully.
I solved it by navigating to the Project settings in the settings.gradle file and COPY and CUT everything then SYNC the project after gradle is complete PASTE back the content you had copied and SYNC again.
This worked for me
Still not worked
Please use different gradle version.
ie case gradle-wrapper.properties. Instead of your version
distributionUrl=https://services.gradle.org/distributions/gradle-*.*.*-all.zip
update with
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Thanks
I tried all the solutions above but I didn't succeed so I uninstall android studio and then installed it again and saw all the problems solved and I have no problem . so I recommend you reinstall the program as a last step .
REINSTALL

Data binding with errror dataBindingArtifactOutputDir

I have a weird problem when building my app.
Cannot write to file
'myapp/app/build/intermediates/data-binding/dev/debug/bundle-bin'
specified for property 'dataBindingArtifactOutputDir' as it is a
directory.
It 's weird because when I clean project, I can build app. But when building app the second time, the above error happens. If I want to build app, must clean app.
I also set
dataBinding {
enabled true
}
Thanks for any support!
I really found the problems. I took me 1 day. I updated the gradle plugin and Android Studio to the newest version. And this is the reason why.
The newest gradle build tool is 3.4.1, it use the gradle version 5.1.1. When I downgrade the gradle build tool to 3.1.4 as my old project, and clean build app again error still happens. I think this way did not work but this is problem of Android Studio, it did not change the gradle version in gradle/wrapper/gradle-wrapper.properties. I manually update to old gradle version
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
It works now luckily. Everytime Android Studio updates, the weird problems happens again. Expect everything will work well in the future. :|

Android Studio update broke Gradle

I just updated my Android Studio 135.14 etc to 135.15.
First, I get an SDK not found error, since now the SDK cannot be in the Android Studio folder any more due to checksum problems. I fixed this as instructed, but now when I try to run my app I get the following message.
Failed to complete Gradle execution.
Cause: tried to access method
com.google.common.base.Stopwatch.()V from class
com.android.tools.idea.gradle.invoker.GradleTasksExecutor$3
I've already tried a clean and to delete .gradle from home. I don't see anything in build.gradle that has anything remotely to do with this and I am unsure on how to proceed.
I am not familiar with gradle at all since it just worked for months until the update.

Syncing Android Studio project with Gradle files

I was working on a project, and then I got a prompt to update Android Studio. After I did that, I started getting this error when trying to run my app
It says
The project may need to be synced with Gradle files
How do I solve this?
EDIT
Starting with Android Studio 3.1, you should go to:
File -> Sync Project with Gradle Files
OLD
Clicking the button 'Sync Project With Gradle Files' should do the trick:
Tools -> Android -> Sync Project with Gradle Files
If that fails, try running 'Rebuild project':
Build -> Rebuild Project
Old Answer
When trying to run the application, instead of selecting the directory highlighted here in blue
I selected the subdirectory instead
and clicked "run".All the issues with Gradle are automatically resolved and the missing apk directory is automatically created.
New Solution
The Sync project with gradle files button disappeared from Android Studio for a while.Its back and you can find it here:
hit the button and wait for the task to complete
I've had this problem after installing the genymotion (another android amulator) plugin.
A closer inspection reveled that gradle needs SDK tools version 19.1.0 in order to run (I had 19.0.3 previously).
To fix it, I had to edit build.gradle and under android I changed to: buildToolsVersion 19.1.0
Then I had to rebuild again, and the error was gone.
Keys combination:
Ctrl + F5
Syncs the project with Gradle files.
The gradle versions in android studio and your code is not the same. This is why even after you update the gradle version on android studio, the error still persist.
So, edit the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file:
distributionUrl = https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Ref: https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle
I am using Android Studio 4 developing a Fluter/Dart application. There does not seem to be a Sync project with gradle button or file menu item, there is no clean or rebuild either.
I fixed the problem by removing the .idea folder. The suggestion included removing .gradle as well, but it did not exist.
i had this problem yesterday. can you folow the local path in windows explorer?
(C:\users\..\AndroidStudioProjects\SharedPreferencesDemoProject\SharedPreferencesDemo\build\apk\)
i had to manually create the 'apk' directory in '\build', then the problem was fixed

Categories

Resources