Grade project sync failed in android studio 3.1.3 - android

InspectAndroidManifest new build.gradle
I have tried almost every solution provided on Stack Overflow related to this 'gradle project syc failed' error, but nothing was useful in my case. I am new to Android Studio and miserably got stuck at the beginning.
In the event log this message appears:
Gradle sync failed: Failed to apply plugin [id 'com.android.application']
Consult IDE log for more details (Help | Show Log) (296ms)
But I am not able to click on (Help | Show Log).
Note: Using Android Studio 3.1.3 and Gradle version 4.9.

it's probably problem with your plugin implementation

Probably you don't have the main class (the one executes when the app starts) that is extended from Application. It will be better to see your AndroidManifest as well.
But i guess, if you remove apply plugin: com.android.application from build.gradle it may work.

Related

Flutter Android build not generating in Mac

In Mac, I've setup Flutter in Android studio. When I'm running project it gives me error
* What went wrong:
Execution failed for task ':location:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
I'm using all latest versions of Flutter, Kotlin, Gradle etc.
You need to equalize kotlin version in first row which is ext.kotlin_version = '1.6.10' to according to classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" of underlined $kotlin_version
After this, the problem will solve...
Actually I found a solution for my problem. There are 2 dependency defined in .yaml file 1. geo_location and 2. location.
After removing the location dependency from .yaml file and run command flutter pub get I can successfully build android build from Mac. This solution might not be global but solution of my problem I found this.
Thank you!
Happy coding.

Gradle plugin 3.5.0: "Failed to transform artifact", "Execution failed for JetifyTransform"

We updated Android Gradle plugin from 3.4.2 to 3.5.0 (and Gradle from 5.1.1 to 5.4.1).
After that, the build started failing in a few submodules. Trying to assemble any build variant yields this (same error on the command line and in Android Studio):
> Failed to transform artifact 'bottom-navigation.aar (project :bottom-navigation)' to match attributes {artifactType=jar}.
> Execution failed for JetifyTransform: <project_root>/bottom-navigation/build/outputs/aar/bottom-navigation-release.aar.
> Failed to transform '<project_root>/bottom-navigation/build/outputs/aar/bottom-navigation-release.aar' using Jetifier.
Reason: Cannot open a library at 'FileMapping(from=<project_root>/bottom-navigation/build/outputs/aar/bottom-navigation-release.aar, to=<project_root>/bottom-navigation/build/.transforms/9b2af95a5f0e0055110660c22ff05ab5/jetified-bottom-navigation-release.aar)'. (Run with --stacktrace for more details.)
Any ideas how to fix this?
What I've tried
"Invalidate caches" in AS and also clearing all Gradle caches in ~/.gradle/caches as suggested in this answer
All the advice in this somewhat similar question
I checked that the problematic modules use apply plugin:
'com.android.library' (instead of com.android.application)
I tried updating appcompat dependency to androidx.appcompat:appcompat:1.1.0 in affected modules and also removing that dependency
Update
It starts to look like something is wrong in Gradle plugin 3.5.0; builds behave erratically for me locally and on our CI machine.
For example, clean builds are failing: ./gradlew clean assembleBetaRelease fails while ./gradlew assembleBetaRelease works!
Also, sometimes I get AAPT: error: attribute ... not found instead of the above Failed to transform artifact error.
Reverting to Gradle plugin 3.4.2, all these problems disappear.
Edit Oct 2019: Still seeing this weird behaviour with Gradle plugin 3.5.1. Edit Nov 2019 And 3.5.2. Upgrading to Gradle 5.6 didn't help either.
A bit weird, but I got it working again. Apparently just a temporary glitch in Android Gradle plugin related to caching.
This answer helped me:
The simple way to solve this is to switch between your build variants. This refreshes the cached copies and resolves the issue.
I couldn't do that in Android Studio since the project sync was failing, but on the command line I tried another variant (in my case ./gradlew assembleBetaDebug having used ./gradlew assembleBetaRelease earlier). The build passed, and after that it worked for all all other variants too, and Gradle sync in Android Studio started working as well!
Edit: actually this is not completely solved; see updated question.
Update 12/2019: bundle* commands work fine, it's only assemble* that fails—still failing with Android Gradle plugin 3.5.3. Building in Android Studio works fine. Obviously this is not a common issue, and I don't know what exactly in the particular project I'm working on is causing this.
Update 04/2020: now with Android Gradle plugin 3.6.2 (and Gradle 5.6.4) builds work for me locally and I was able to update the project. On CircleCI, the build still occasionally fails with "Failed to transform artifact" but re-running fixes it. Go figure 🤔

Android Studio: Can't sync Gradle Project

I am currently experiencing a strange issue with Android Studio and Gradle.
Android Studio: 3.4.2
Gradle: 2.10
When I try to sync the Android Studio Project the sync finishes in 969ms with CONFIGURE SUCCESSFUL followed by a red 1
Here is Android Studio's IDEA log
It looks like there is some kind of exception, but I can't figure out why.
Another interresting thing is that I can execute ./gradlew build --info without any issues.
The logs without the build.gradle is useless information ...
and one cannot use Gradle 2.10 with Android Studio 3.4.2
... you'd have to upgrade at least to Gradle 5.1.0.
I just stumbled over a solution by googling some of the log content.
Adding com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
after apply plugin: 'com.google.gms.google-services'
It just works!
Here is the original post: https://stackoverflow.com/a/54504968/1766321

Gradle project sync failed. basic functionality (e.g. editing debugging) will not work properly

My Gradle project sync failed. Basic functionality (e.g. editing debugging) will not work properly.
I installed Android Studio and updated everything (3.2.1) , but whenever I create new project I get these 3 errors :
Failed to resolve: com.android.support:appcompat-v7:28.0.0
Failed to resolve: com.android.support.constraint:constraint-layout:1.1.3
Failed to resolve: com.android.support.test:runner:1.0.2
What's wrong?
Thanks in advance
You might need a Proxy to achieve a successful Gradle sync!
Because repositories are restricted to access from IRAN.
Also you can use Shecan.ir and set your dns to the ip from this site.
If it was't about your proxy access! please share complete gradle & error here
Please check if your build.gradle(Project) looks like this
and if not, try to change change gradle version to be as same as on this photo.
Hope this help
i found some way for android studio 4.2
check bottom left
step 1 : find build
step 2 : you will get message sync error
step 3 : message will say to install missing gradle
step 4 : install it
and done , its work for me

Gradle sync failed: Can’t get application id "com.Growl.GrowlHelperApp"

After i upgrade to Android 2.1.3 i got this error:
"1:05:48 PM Gradle sync failed: Can’t get application id "com.Growl.GrowlHelperApp".
Consult IDE log for more details (Help | Show Log)
1:06:42 PM Gradle sync started
1:06:43 PM Gradle sync failed: Can’t get application id "com.Growl.GrowlHelperApp".
Consult IDE log for more details (Help | Show Log)
Have no clue what should i do, any help? thanks!
While I'm not certain if this counts as a canonical "answer", when I installed macOS Sierra, I did get a notification stating that Growl would no longer run. This appears to be supported by Growl's own website as it cannot even be built from source on a modern Xcode or OS X see: http://growl.info/documentation/developer/growl-source-install.php
Unless we can find a way to strip the reliance on Growl out of the Android Studio itself, I don't know that it will be functional on macOS Sierra. It does appear to be baked into several of the jars, though I'm sure someone more resourceful than I will come up with a nifty workaround.
EDIT I was able to build my project by opening the project's build.gradle (Project: project_name_here), and commenting out:
//apply plugin: 'announce'
//apply plugin: 'build-announcements'
From the bottom of the file. This did allow gradle to continue and build my project, which is running just fine.
I downgrade my gradle by choose "Pereference" -> "Build, Execution, Deployment" -> Gradle - > "Use default gradle wrapper(recommended)" then it works.

Categories

Resources