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

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

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 ':flutter_plugin_android_lifecycle'

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.

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!

react-native - unable to run sample app

Following the tutorial here, I am unable to run the app in the emulator. When I execute the react-native run-android command from the DOS prompt, here is the error I get:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'AwesomeProject'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.2.3.
Required by:
:AwesomeProject:unspecified
> Could not resolve com.android.tools.build:gradle:2.2.3.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/to
ols/build/gradle/2.2.3/gradle-2.2.3.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/bu
ild/gradle/2.2.3/gradle-2.2.3.pom'.
> repo1.maven.org
> Could not resolve com.android.tools.build:gradle:2.2.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools
/build/gradle/2.2.3/gradle-2.2.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build
/gradle/2.2.3/gradle-2.2.3.pom'.
> jcenter.bintray.com
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
Things I tried:
Editing build.gradle file and changing classpath from classpath 'com.android.tools.build:gradle:2.2.3' to com.android.tools.build:gradle:3.3.0' (the version I have installed with Android Studio).
Verified that jcenter() is listed as a repository in build.gradle under both buildscript and allprojects
Try setting it to 2.3.0
Strange, I can't see any 2.2.3 in that path but I can see a 2.3.0
http://repo1.maven.org/maven2/com/android/tools/build/gradle/
I recreated the project using the react-native cli, and the issue seemed to correct itself. I should note that I believe I had not installed android studio when I initially created the project, so maybe that had something to do with it, not sure.