Error when build react native for task ':app:prepareComAndroidSupportSupportV42301Library' - windows

I'm new react-native developer. When i run react native in windows with "react-native run-android", it return error :
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library
:app:prepareComAndroidSupportSupportV42301Library FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:prepareComAndroidSupportSupportV42301Library'.
Could not expand ZIP 'C:\Android\sdk\extras\android\m2repository\com\android\support\support-v4\23.0.1\support-v4-23.0.1.aar'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15 mins 33.768 secs
Can you help me fix this problem? thank!

I had the exact same issue and it turns out it's got to do with the google play-services-analytics version.
and by adding the following code to the build.gradle file I was able to get rid of the error.
compile("com.google.android.gms:play-services-analytics:8.3.0"){
force = true
}
add it at the top of the dependencies curly braces.
so that it looks like this.
dependencies { compile("com.google.android.gms:play-services- analytics:8.3.0"){
force = true
}
//the rest of the dependencies follow
Go t the page below for a better and more detailed explanation
https://github.com/idehub/react-native-google-analytics-bridge/issues/31

Related

how can i fix this issue

when i run flutter run in my project, the compile failed. i got this code in verbose mode
ADMIN#ZIRCON-KH101 MINGW64 ~/Documents/android project/new/flutternewsapp-10/codecanyon-26536344-classic-flutter-news-app-best-for-news-blog-and-magazines/01. Flutter/classic_flutter_news
$ flutter run
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Target debug_android_application failed: FileSystemException: Creation failed, path = 'C:\Users\ADMIN\Documents\android project\new\flutternewsapp-10\codecanyon-26536344-classic-flutter-news-app-best-for-news-blog-and-magazines\01. Flutter\classic_flutter_news\build\app\intermediates\flutter\debug\flutter_assets\packages/cupertino_icons' (OS Error: The filename or extension is too long.
, errno = 206)
build failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 23.9s
Exception: Gradle task assembleDebug failed with exit code 1
how can i fix this issues cause i already run flutter packages get, flutter clean inside my project and pass my release to stable channel
Your File path is too long.
C:\Users\ADMIN\Documents\android project\new\flutternewsapp-10\codecanyon-26536344-classic-flutter-news-app-best-for-news-blog-and-magazines\01. Flutter\classic_flutter_news\build\app\intermediates\flutter\debug\flutter_assets\packages/cupertino_icons
this exceeds some limitations in compilers and some programs.
so simply move your project folder to something simple like C:\Projest\
also change the name of this folder to something shorter
codecanyon-26536344-classic-flutter-news-app-best-for-news-blog-and-magazines

Minecraft Forge Gradle with VSCode

I am trying to create a Minecraft Mod using VSCode as this is my main editor for school, but when I try to run the command gradlew genVSCodeRun I get the follwoing output that says successful, but also "Could not resolve: net.minecraftforge:forge:1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3". When I then run gradlew build, the following it output:
Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
Could not find net.minecraftforge:forge:1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.
Searched in the following locations:
- file:/C:/Users/eabla/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.1.0_mapped_snapshot_20200119-1.15/forge-1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- file:/C:/Users/eabla/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.1.0_mapped_snapshot_20200119-1.15/forge-1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://libraries.minecraft.net/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 40s
1 actionable task: 1 executed
Any idea what this could be? I have done a fresh install of java JDK and JRE as well as a fresh install of the Forge MDK.
Your Forge Library is missing. Run the command gradlew eclipse after navigating into your project directory. It may take some time but it will surely fix it. :D
Make sure you have the JDK (java development kit https://www.oracle.com/java/technologies/javase-jdk8-downloads.html) installed not just the JRE

When i am trying to run my flutter app it getting an Error running gradle

i am getting an error when i trying to run the app. please help. The error in cmd is below -
Error running Gradle:
ProcessException: Process "C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\app\build.gradle' line: 14
What went wrong:
A problem occurred evaluating project ':app'.
ASCII
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 14s
Command: C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
line nine in app-build-gradle is below-
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
There could be many reasons for such a error. I had a similar error. I would suggest you to open your project in android studio and check your gradel versions. I see by the name of you app that you are using firebase. Some of those plugins use Androidx. So migrating your project to Androidx might help. Here's how to migrate your project to Androidx.
Hope it helps!
I had the same issue this may because of the incompatibility of Gradle versions.
I opened the android part in Android Studio and updated Gradle as recommended by Android Studio with Alt+Enter and it solved my problem.
I can elaborate more if you can post more details about it e.g your app/gradle file.

Android studio build error

Tried to create my first project in android studio, using one of the examples im trying to run the application, but gradle gives me this build error (didnt change one line of code - just trying to run the Empty activity):
Gradle: FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':Passivelocation:packageDebug'.
org.bouncycastle.asn1.ASN1Integer.(J)V
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Ive tried adding info and debug while running the command on with the cli but i cant make much of the output it gives me.
Any suggestions?
I faced the same failure and the problem was with my jdk/jre because some time ago I added the Bouncy Castle Crypto APIs functionality by adding the jar to my jdk/jre path.
I tried a gradle build with a "clean" jdk/jre and problem was solved

AndroidStudio Unambiguous Errors

I've been using AndroidStudio and it has a few inconsistencies but it's very good already.
I've been compiling and running my app fine and then suddenly (after doing something innocuous) it's throwing up the below error but i cannot find out the issue. Does anyone have any ideas how to find out the errors?
Compilation completed with 2 errors and 0 warnings in 46 sec
2 errors
0 warnings
Gradle:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':Candle:compileDebug'.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
If nothing has really changed in your project settings, then I'd check the log (Help | Show log in Files/Explorer/Finder) for clues. Most likely, the Gradle daemon died, and a rebuild should fix it.
If that doesn't help, then your only option to find more info is to do a command line build. Go to the root of your project, and do:
./gradlew assemble
The best way I've found to get to the errors is to run gradle compile and/or package from the command line. In the root of your project run:
gradlew compileDebug
AND / OR
gradlew packageDebug
This will give you command line output for your errors
It also sometimes helps to run a gradle clean before running builds:
gradle clean
Hope this helps

Resources