gradlew app:dependencies does not work - android

I want to see which library uses play-services.
I command gradlew app:dependencies in my Android Studio terminal. It throws this:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Projects\project\android\app\build.gradle' line: 18
* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
The 18th line of my app gradle is: apply plugin: 'com.android.application'
Any ideas?

Run with Java 8.
52 missmatch:
https://javarevisited.blogspot.com/2015/05/fixing-unsupported-majorminor-version.html
probably got this in build.gradle as well?
sourceCompatibility = 1.8
targetCompatibility = 1.8

Related

What version of Gradle plugin do I use in my Android app?

I have the following build.gradle in my Android app:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
}
}
repositories {
google()
mavenCentral()
}
apply plugin: 'com.android.application'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'com.google.android.gms:play-services-ads:21.3.0'
implementation "com.android.billingclient:billing:4.0.0"
}
and get a warining:
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33
This Android Gradle plugin (7.0.2) was tested up to compileSdk = 31
This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties
The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
But when I try to use Gradle plugin 7.4 I get this:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android-build'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:7.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.4/gradle-7.4.pom
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.4/gradle-7.4.pom
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
with 7.2 I get this:
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\dev\repos\examples\src\LinesGame\build-LinesGameQt-Android_Qt_6_4_0_x86_64_debug_Clang_x86_64-Debug\android-build\build.gradle' line: 17
* What went wrong:
A problem occurred evaluating root project 'android-build'.
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 7.4. Current version is 7.2. If using the gradle wrapper, try editing the distributionUrl in D:\dev\repos\examples\src\LinesGame\build-LinesGameQt-Android_Qt_6_4_0_x86_64_debug_Clang_x86_64-Debug\android-build\gradle\wrapper\gradle-wrapper.properties to gradle-7.4-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
What is happening?
EDIT1
If I spefify 7.3.1 version in build.gradle I get the following strange error message:
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\dev\repos\examples\src\LinesGame\build-LinesGameQt-Android_Qt_6_4_0_x86_64_debug_Clang_x86_64-Debug\android-build\build.gradle' line: 17
* What went wrong:
A problem occurred evaluating root project 'android-build'.
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 7.4. Current version is 7.2. If using the gradle wrapper, try editing the distributionUrl in D:\dev\repos\examples\src\LinesGame\build-LinesGameQt-Android_Qt_6_4_0_x86_64_debug_Clang_x86_64-Debug\android-build\gradle\wrapper\gradle-wrapper.properties to gradle-7.4-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
What can it be?
Version 7.4 of the Android Gradle plugin doesn't exist, the latest stable version is 7.3.1, as you can see in the Google's Maven repo index. Other versions you could use are 7.4.0-beta02 and 8.0.0-alpha05.

Flutter Android resource linking failed and Failed to apply plugin [id 'kotlin-android']

Opened a project after 2 months, got null-safety error changed some plugins, and upgraded others, one thing led to another and now I am stuck at this error!
Tried Flutter clean and deleting the build and .gradle folder but nothing worked.
Launching lib\main.dart on RMX1801 in debug mode...
lib\main.dart:1
3
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\Dell\.gradle\caches\transforms-2\files-2.1\b94a6b46912fba96397655c3d1ce5de0\play-services-ads-lite-19.6.0\AndroidManifest.xml:27:5-38:15: AAPT: error: unexpected element <queries> found in <manifest>.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8m 59s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin audioplayers...
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Dell\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.18.2\android\build.gradle' line: 25
* What went wrong:
A problem occurred evaluating root project 'audioplayers'.
> Failed to apply plugin [id 'kotlin-android']
> The current Gradle version 4.10.2 is not compatible with the Kotlin Gradle plugin. Please use Gradle 5.3 or newer, or the previous version of the Kotlin plugin.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 54s
2
Exception: The plugin audioplayers could not be built due to the issue above.
Exited (sigterm)
You're getting a AAPT: error: unexpected element <queries> found in <manifest>. it looks like you have to update your gradle version to one of the ones listed here
https://github.com/miguelpruivo/flutter_file_picker/wiki/Troubleshooting
3.3.3
3.4.3
3.5.4
3.6.4
4.0.1
it looks like you need to downgrade your gradle version since you're using 4.10.2

flutter A problem occurred evaluating project ':app'. > Failed to apply plugin [id 'com.android.internal.version-check']

I have a problem running my flutter app. ERORR : "Failed to apply plugin [id 'com.android.internal.version-check']
Console:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\ariel\AndroidStudioProjects\study_app\android\app\build.gradle' line: 24
What went wrong:
A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'com.android.internal.version-check']
Minimum supported Gradle version is 6.5. Current version is 5.6.2. If using the gradle wrapper, try editing the distributionUrl in C:\Users\ariel\AndroidStudioProjects\study_app\android\gradle\wrapper\gradle-wrapper.properties to gradle-6.5-all.zip
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2s
Exception: Gradle task assembleDebug failed with exit code 1
`
Please Can someone help me?
`
Edit the distributionUrl in gradle-wrapper.properties in file: /android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
Change zip package to gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

flutter-firebase_auth- gradlew.bat exited abnormally

""I WAS TRYING TO CONNECT MY FLUTTER APP TO FIREBASE"
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "C:\flutter\project\notification\flutterapp\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\flutter\project\notification\flutterapp\android\app\build.gradle' line: 1
What went wrong:
A problem occurred evaluating project ':app'.
Could not find method Properties() for arguments [] on project ':app' of type org.gradle.api.Project.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Command: C:\flutter\project\notification\flutterapp\android\gradlew.bat app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
The issue occurs due to older gradle version in project.
Solved the issue by updating Project level build.gradle under dependencies classpath 'com.android.tools.build:gradle:3.5.1' and gradle-wrapper.properties to gradle-5.4.1-all
https://github.com/FirebaseExtended/flutterfire/issues/335#issuecomment-547273581

Pipelines: Minimum supported Gradle version is 4.10.1. Current version is 4.4

I have updated top-level build.gradle file :
from
classpath 'com.android.tools.build:gradle:3.1.4'
to
classpath 'com.android.tools.build:gradle:3.3.0'
And now cant build project on Bitbucket-Pipelines:
Error is:
FAILURE: Build failed with an exception.
* Where:
Build file '/opt/atlassian/pipelines/agent/build/app/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Minimum supported Gradle version is 4.10.1. Current version is 4.4. If using the gradle wrapper, try editing the distributionUrl in /opt/atlassian/pipelines/agent/build/gradle/wrapper/gradle-wrapper.properties to gradle-4.10.1-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 37s
Minimum supported Gradle version is 4.10.1. Current version is 4.4.
The statement itself says the solution
Please change inside
project>gradle>wrapper>gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

Categories

Resources