A problem occurred configuring project ':flutter_plugin_android_lifecycle' - imagepicker

I added "image_picker: ^0.8.4+11" package to my project.
After adding it was returning this error.
What went wrong:
A problem occurred configuring project ':flutter_plugin_android_lifecycle'.
Could not resolve all artifacts for configuration ':flutter_plugin_android_lifecycle:classpath'.
Could not find gradle-3.5.0.jar (com.android.tools.build:gradle:3.5.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.jar
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

I have similar problem , on windows and Gradle:3.5.0 .
any package using this Gradle Version has Error .
I Solved problem by clean cache of Gradle in this address:
C:\Users\<MY_ACCOUNT>\.gradle\caches
and then , resync project an android module.

I updated the gradle to latest version and the problem was solved.
Go to android\gradle\gradle-wrapper.properties and change the gradle version to the last one.

Related

react native new project cant run android from vs code terminal

i created a new project and run
npx react-native run-android
command in visual studio code terminal. but i got an error
What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
* 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 21s
but i can build the app with the same command in using iterm
what is difference? cause idk what changed and. i didnt changed anything

A problem occurred configuring project ':react-native-static-server'

Problem facing in the android app setup with error
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/rover/Desktop/appflow/node_modules/react-native-static-server/android/build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-static-server'.
> Plugin with id 'maven' 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 ':react-native-static-server'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
I am getting this error on android while installing the app on the emulator. Checked with some online answers but not able to resolve it.
Basically it is not good solution, but you can go inside of node modules and find your package, after open android folder and do the next instead of using:
apply plugin: 'maven'
you should use
apply plugin: 'maven-publish' and it will solve error. I will not recommend to do so, but it might help. Enjoy

KMM - Error Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'

I created a project to demo Kotlin Multiplatform Mobile. I built and ran it successfully on both devices: Android and iOS. After that, I re-ran the project on iOS. It had an error.
> Configure project :shared
Kotlin Multiplatform Projects are an Alpha feature. See: https://kotlinlang.org/docs/reference/evolution/components-stability.html. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.
FAILURE: Build failed with an exception.
* What went wrong:
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
* Try:
Run gradlew tasks to get a list of available tasks. 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 PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script /Volumes/Data/ProjectsKMM/DemoNetworkAPI/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh
(1 failure)
This is my project on Github Click here. Please see it and help me to find the error.
Thanks in advance.
You need to use at least Kotlin 1.5.20 for embedAndSignAppleFrameworkForXcode to be available (more info in https://blog.jetbrains.com/kotlin/2021/07/multiplatform-gradle-plugin-improved-for-connecting-kmm-modules/)
embedAndSignPodAppleFrameworkForXcode worked for me
Kotlin plugin version: 212-1.7.10-release-333-AS5457.46
This was the suggestion from xcode/Android Studio regarding failed task
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'. Some candidates are: 'embedAndSignPodAppleFrameworkForXcode'.

Why do I get the error: Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher

I tried to start my app, but I get a error... I intigrated google_maps_flutter: ^1.0.2 and geolocator: ^2.1.0. So one of this has to be the problem, but I don't understand what the error means.
Error:
FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
The following dependencies do not satisfy the required version:
root project 'android' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
* 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 6s
Exception: Gradle task assembleDebug failed with exit code 1
But in my build.gradl I have the line: ext.kotlin_version = '1.3.50' and this is higher then 1.2.71
You have to use the geolocator version geolocator: ^5.1.3

Execution failed for task ':app:preDebugBuild'

I'm working on a route map app with Flutter using google_maps_webservice,location,map_view package after run
Launching lib\main.dart on SAMSUNG SM G530AZ in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:preDebugBuild'.
Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (15.0.1) and runtime (16.0.1) classpath. You should manually set the same version via DependencyResolution
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
Finished with error: Gradle task assembleDebug failed with exit code 1
Finaly after sevral day i've found, the package map_view have many dependencies conflict between the migration androidX and android.support: so instead of continue using mapview I'm using cirrus_map_view the correction version of map_view and it work!