A problem occurred configuring project ':background_locator' - android

While build the app get an error like
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':background_locator'.
> Could not load compiled classes for build file 'C:\flutter\.pub-cache\hosted\pub.dartlang.org\background_locator-1.6.12\android\build.gradle' from cache.
* 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 23s
Exception: Gradle task assembleDebug failed with exit code 1
How to solve this issue

Related

I tried to run the App, But Gradle is throwing this error

`
FAILURE: Build failed with an exception.
Where:
Build file '/Users/theroushan/Documents/NextSchool/android/app/build.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':app'.
No signature of method: build_4a37y44n4qcdao4l4d5njw5b5.android() is applicable for argument types: (build_4a37y44n4qcdao4l4d5njw5b5$_run_closure2) values: [build_4a37y44n4qcdao4l4d5njw5b5$_run_closure2#73288fd8]
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
Exception: Gradle task assembleDebug failed with exit code 1`
I tried to run the app, but I am getting this error in flutter?

FAILURE: Build failed with an exception. flutter

What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':classpath'.
Could not load module metadata from C:\Users\Pemula.gradle\caches\modules-2\metadata-2.96\descriptors\com.google.code.findbugs\jsr305\3.0.2\a8be1fe3b3911d3d3425fe720cf42835\descriptor.bin
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 11s
Exception: Gradle task assembleDebug failed with exit code 1

failed to build react native project

I had been able to build and run the react-native project in my old intel based mac successfully. Recently I migrated my project to the apple silicon and now I'm having issues building and running react-native project on m1 mac. When I run the npx react-native run-android I get below error message in the console:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/sussol/Documents/Git/mobile/android/app/build.gradle' line: 120
* What went wrong:
A problem occurred evaluating project ':app'.
> ../package.json (No such file or directory)
* 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 ':app'.
> 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 2m 4s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/sussol/Documents/Git/mobile/android/app/build.gradle' line: 120
* What went wrong:
A problem occurred evaluating project ':app'.
> ../package.json (No such file or directory)
* 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 ':app'.
> 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
I tried various things to get it working like cleaning gradle, using different build tools versions etc. But none of them worked. Does anybody has any idea what's going on here? Any help would really be appreciated. Thanks.

Unable to run Flutter Project with Package

I created a new app.
Added audioplayers flutter package from https://pub.dev/packages/audioplayers.
Shows an error from Android Embedding. I followed the instructions https://flutter.dev/go/android-project-migration.
Now I get this error:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.17.1\android\build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':audioplayers'.
> Plugin with id 'kotlin-android' 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':audioplayers'.
> compileSdkVersion is not specified.
* 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 3s
Exception: Gradle task assembleDebug failed with exit code 1
Then I followed https://github.com/react-native-webview/react-native-webview/issues/1407 thread to do what suggested.
Now I'm getting this error:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\src\flutter\flutter.pub-cache\hosted\pub.dartlang.org\audioplayers-0.17.1\android\build.gradle' line: 49
What went wrong:
A problem occurred evaluating project ':audioplayers'.
Could not get unknown property 'kotlin_version' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
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 4s
Exception: Gradle task assembleDebug failed with exit code 1
I'm very new in android studio development, it drives me crazy with these configurations. Thank you very much.
For those who came up with the same problem I have. The project I'm working came from Git and I think that project wasn't updated for Android Embedding v2 so I got the first error.
Now in the second error, all I did was to read other's bug fixes (not officially).
Adding the dependencies and kotlin-version (1.4.20) needed for the main package(audioplayers). C:\flutter\flutter.pub-cache\hosted\pub.dartlang.org\audioplayers-0.17.1\android\
Making the android project's app build.gradle>defaultConfig>minSdkVersion to 23 (from 16)
Use pub get and update in pubspec.yaml.

Error when version upgrade in pubspec.yaml

Flutter,android
I can't understand.
Error has occured, when I upgrading version in 'pubspec.yaml'
version: 1.0.1+2 was no problem. build done!
but, 1.0.2+3, 1.0.3+4, .. ERROR!!!! build failed!!
even though 1.0.0+1.. error too..
What should I do?
no problem
error screenshot
error info is
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NullPointerException (no error message)
* 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 13s
Finished with error: Gradle task assembleDebug failed with exit code 1

Categories

Resources