Android Gradle update to 6.2.2 NoSuchMethodError with DeprecationLogger.nagUserWith - android

When I update in an Android project Gradle to 6.2.2 from 6.1.1 I run into this non-understandable error.
> Configure project :commonLib
The BuildListener.buildStarted(Gradle) method has been deprecated. This is scheduled to be removed in Gradle 7.0. Consult the upgrading guide for further information: https://docs.gradle.org/6.2.2/userguide/upgrading_version_5.html#apis_buildlistener_buildstarted_and_gradle_buildstarted_have_been_deprecated
at build_bpg7owlpe9pidz38268q3rf54.run(/builds/cross/mxtracks/commonLib/build.gradle:1)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
Internal API constructor DefaultDomainObjectSet(Class<T>) has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use ObjectFactory.domainObjectSet(Class<T>) instead. See https://docs.gradle.org/6.2.2/userguide/custom_gradle_types.html#domainobjectset for more details.
at build_bpg7owlpe9pidz38268q3rf54.run(/builds/cross/mxtracks/commonLib/build.gradle:1)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
> Configure project :MXApp
Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':MXApp'.
> Failed to notify project evaluation listener.
> java.lang.NoSuchMethodError: org.gradle.util.DeprecationLogger.nagUserWith(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
> KotlinJvmAndroidCompilation with name 'paidRelease' not found.
* 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 1m 3s
I'm out of ideas, even
defaultConfig {
...
android.ndkVersion '21.0.6113669'
}
shows the same result. Maybe someone can help ?

I found the reason, running the gradle task with --stacktrace helps me to find the reason.
It was gradle-play-publisher and this release 2.7.5 solved it finally

Related

Error while using flutter background_location package

I just imported the package background_location, and didn't use it. Even though I get this error
* What went wrong:
Execution failed for task ':background_location:compileDebugKotlin'.
> Compilation error. See log for more details
* 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 43s
Exception: Gradle task assembleDebug failed with exit code 1
Tried changing kotlin version, changed minSdkVersion but no change.
Here are a few things you can do:
run flutter clean and flutter pub get and then try again.
go to your android/app/build.gradle and upgrade the Kotlin version. Latest right now is 1.6.0 i.e. ext.kotlin_version = '1.6.0'
Go to android/gradle/wrapper/gradle-wrapper.properties and upgrade distributionURL to distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
This is where I got these solutions from, Flutter: Execution failed for task ':app:compileDebugKotlin'.
Update: Change your dependency in your pubspec.yaml to:
background_location:
git:
url: https://github.com/hilalbaig/background_location.git
ref: master
Here is the reference: https://github.com/Almoullim/background_location/issues/150#issuecomment-1132144094

A problem occurred evaluating project ':stripe_stripe-react-native'

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
Where:
Build file '/home/kashi/React Native/taajfoodmobile/node_modules/#stripe/stripe-react-native/android/build.gradle' line: 29
What went wrong:
A problem occurred evaluating project ':stripe_stripe-react-native'.
No signature of method: build_526hb1oh4bfs3lomhun33ieeh.android() is applicable for argument types: (build_526hb1oh4bfs3lomhun33ieeh$_run_closure1) values: [build_526hb1oh4bfs3lomhun33ieeh$_run_closure1#23e66cbe]
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 5s
buildFeatures used in stripe-react-native SDK is available from Gradle plugin >= 4.x versions only.
Please refer to this GitHub issue https://github.com/stripe/stripe-react-native/issues/203 for details.

Flutter: upgrading firebase_ml_vision dependency from 0.9.x to 0.10.0

My flutter project runs fine with Firebase ML Vision 0.9.x, if I try to upgrade to 0.10.0 (or higher), it yields the following errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\...\Cache\hosted\pub.dartlang.org\firebase_ml_vision-0.10.0\android\build.gradle' line: 26
* What went wrong:
A problem occurred evaluating project ':firebase_ml_vision'.
> Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':firebase_ml_vision'.
> compileSdkVersion is not specified. Please add it to build.gradle
* 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 889ms
Exception: Gradle task assembleDebug failed with exit code 1
The first of those two errors is weird because the setup instructions and the package install guidelines both say that firebase_core is not required (anymore).
The second is just plain wrong, as my app's build.gradle specifies compileSdkVersion 30 and the firebase_ml_vision package's build.gradle specifies compileSdkVersion 29.
Any ideas what's going on?
Found a solution that works:
Ignore the setup instructions and add firebase_core as a dependency. Then, add the 'implementations' according to this thread to solve the 'Duplicate class' issues.

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

Generating APK fails with ./gradlew

I have a React Native app, which works fine on emulators. I'm trying to build its APK file. I followed this tutorial for the same.
However when I run the command ./gradlew assembleRelease I get this error:
FAILURE: Build failed with an exception.
* What went wrong: Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all task dependencies for configuration ':app:lintClassPath'.
> Could not resolve com.android.tools.lint:lint-gradle:26.5.3.
Required by:
project: app
> Could not resolve com.android.tools.lint:lint-gradle:26.5.3.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/26.5.3/lint-gradle-26.5.3.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/26.5.3/lint-gradle-26.5.3.pom'.
> Connect to dl.google.com:443 [dl.google.com/2404:6800:4009:80a:0:0:0:200e] failed: Network is unreachable (connect failed)
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 8s
I searched around for the solution and found this StackOverflow question, whose answer provides the pom file.
But I don't know where to put it.
How do I resolve this error?

Categories

Resources