Error while trying to run react-native on ubuntu - java

I'm trying to run react-native on Ubunty 16.04..When I go to my project folder and type
react-native run-android
I'm getting the following error
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not create an instance of type com.sun.tools.javac.api.JavacTool.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Please help me solve this issue

Related

Execution failed for task ':firebase_auth:compileReleaseJavaWithJavac'

Updated my flutter to flutter 3.0.5 and I tried torun flutter build when I got the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':firebase_auth:compileReleaseJavaWithJavac'.
> Could not resolve all files for configuration ':firebase_auth:releaseCompileClasspath'.
> Failed to transform firebase-auth-21.0.6.aar (com.google.firebase:firebase-auth:21.0.6) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
> zip END header 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 6m 5s
Running Gradle task 'assembleRelease'... 368.0s
Gradle task assembleRelease failed with exit code 1

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 (React Native)

I have been facing this error for 2 days on Linux(Ubuntu 20.04) machine, and I have tried almost every possible solution found on stack-overflow and git-hub but I could'not resolve this. Any idea about this error?
Task :app:compileDebugJavaWithJavac
Task :app:mergeDebugJavaResource FAILED
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
217 actionable tasks: 3 executed, 214 up-to-date
Note: /home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/android/app/src/debug/java/com/denaio/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform bcprov-jdk15on-1.69.jar (org.bouncycastle:bcprov-jdk15on:1.69) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /home/fareed/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.69/91e1628251cf3ca90093ce9d0fe67e5b7dab3850/bcprov-jdk15on-1.69.jar.
> Failed to transform '/home/fareed/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.69/91e1628251cf3ca90093ce9d0fe67e5b7dab3850/bcprov-jdk15on-1.69.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
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 24s
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
Note: /home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/android/app/src/debug/java/com/denaio/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform bcprov-jdk15on-1.69.jar (org.bouncycastle:bcprov-jdk15on:1.69) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /home/fareed/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.69/91e1628251cf3ca90093ce9d0fe67e5b7dab3850/bcprov-jdk15on-1.69.jar.
> Failed to transform '/home/fareed/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.69/91e1628251cf3ca90093ce9d0fe67e5b7dab3850/bcprov-jdk15on-1.69.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
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 24s
at makeError (/home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/node_modules/execa/index.js:174:9)
at /home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (/home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
at async Command.handleAction (/home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/node_modules/react-native/node_modules/#react-native-community/cli/build/index.js:186:9)

Failed to install the app. Make sure you have the Android development environment set

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.bat app:installDebug -PreactNativeDevServerPort=8081
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.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
ERROR:: AAPT: error: failed writing to 'C:\Users\ASUS\Desktop\BuildWithAngga\MyDoctor\MyDoctor3\android\app\build\intermediates\runtime_symbol_list\debug\R.txt': The data is invalid. (13).
* 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 6m 47s
So i have been trying to do npm run android but i keep on getting these errors: i have tried npm react-native doctor and it showed that my java jdk, android home, android sdk and studio are downloaded... i have also tried changing the gradle url bt still didnt work. Anyone has any idea why?

Ionic Builed Project Failed : Could not determine the dependencies of task ':app:lintVitalRelease'

I'm new with ionic frameworks. i'm try to to build android with command sudo build --release android and get error as below
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.appcompat:appcompat:1.0.0, androidx.versionedparcelable:versionedparcelable:1.0.0, androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.core:core:1.0.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.vectordrawable:vectordrawable:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
* 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 16s
Command failed with exit code 1: /Users/Muhamadkhairuldin/Google Drive/SifuApps/Apps/usahaone5/platforms/android/gradlew cdvBuildRelease -b /Users/Muhamadkhairuldin/Google Drive/SifuApps/Apps/usahaone5/platforms/android/build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova build android --release exited with exit code 1.
can anybody help me how to solve this?

nativescript-ng2-carousel error after installing when run tns build android

I am making a nativescript app and want to add a carousel by using nativescript-ng2-carousel but after I did npm i nativescript-ng2-carousel I get an error saying
Warning: there already is an extend called com.tns.NativeScriptActivity.
Warning: there already is an extend called com.tns.FragmentClass.
Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
File:D:\Documents\coursera_examples\nativescript\VilcabambaHotel\platforms\android\app\src\main\java\com\tns\gen\java\lang\Object_button_19_32_ClickListenerImpl.java Class:
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:81)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:47)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:runSbg'.
Process 'command 'C:\Program Files\Android\Android Studio\jre\bin\java.exe'' 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 10s
Command gradlew.bat failed with exit code 1
I have tried updating my typescript, I have deleted node_modules and reinstalled, I have removed and added platforms and still get the same error

Categories