I run npx react-native run-android and I get this
This seems to be the problem, It's looking for platform tools in ~/ and not in ~/Android/Sdk
java.io.IOException: Cannot run program "/home/u/platform-tools/adb": error=2, No such file or directory
`
You can ignore this, stack won't let me post this if I don't add more text, but I think it's already a good explanation
> Task :app:compileDebugJavaWithJavac
> Task :app:stripDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libbetter.so, libc++_shared.so, libevent-2.1.so, libevent_core-2.1.so, libevent_extra-2.1.so, libfabricjni.so, libfb.so, libfbjni.so, libflipper.so, libfolly_futures.so, libfolly_json.so, libglog.so, libglog_init.so, libimagepipeline.so, libjsc.so, libjscexecutor.so, libjsi.so, libjsijniprofiler.so, libjsinspector.so, liblogger.so, libmapbufferjni.so, libnative-filters.so, libnative-imagetranscoder.so, libreact_codegen_rncore.so, libreact_debug.so, libreact_nativemodule_core.so, libreact_render_animations.so, libreact_render_attributedstring.so, libreact_render_componentregistry.so, libreact_render_core.so, libreact_render_debug.so, libreact_render_graphics.so, libreact_render_imagemanager.so, libreact_render_leakchecker.so, libreact_render_mapbuffer.so, libreact_render_mounting.so, libreact_render_runtimescheduler.so, libreact_render_scheduler.so, libreact_render_telemetry.so, libreact_render_templateprocessor.so, libreact_render_textlayoutmanager.so, libreact_render_uimanager.so, libreact_utils.so, libreactconfig.so, libreactnativeblob.so, libreactnativejni.so, libreactnativeutilsjni.so, libreactperfloggerjni.so, librrc_image.so, librrc_modal.so, librrc_progressbar.so, librrc_root.so, librrc_scrollview.so, librrc_slider.so, librrc_switch.so, librrc_text.so, librrc_textinput.so, librrc_unimplementedview.so, librrc_view.so, libturbomodulejsijni.so, libyoga.so.
> Task :app:installDebug FAILED
31 actionable tasks: 31 executed
Note: /home/u/Desktop/workdir/Math_App/mathapp/android/app/src/debug/java/com/mathapp/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
[adb]: Cannot run program "/home/u/platform-tools/adb": error=2, No such file or directory
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> java.io.IOException: Cannot run program "/home/u/platform-tools/adb": error=2, 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 13m 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
Note: /home/u/Desktop/workdir/Math_App/mathapp/android/app/src/debug/java/com/mathapp/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
[adb]: Cannot run program "/home/u/platform-tools/adb": error=2, No such file or directory
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> java.io.IOException: Cannot run program "/home/u/platform-tools/adb": error=2, 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 13m 4s
at makeError (/home/u/Desktop/workdir/Math_App/mathapp/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /home/u/Desktop/workdir/Math_App/mathapp/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/home/u/Desktop/workdir/Math_App/mathapp/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/home/u/Desktop/workdir/Math_App/mathapp/node_modules/#react-native-community/cli/build/index.js:192:9)
Check where your $ANDROID_HOME variable is pointing to.
echo $ANDROID_HOME
If must be equal to the path of Android/Sdk, usually at ~/Android/Sdk
A solution, if you know where the variable ANDROID_HOME is (maybe ~/.bashrc, ~/.profile):
Go to the file you've the var ANDROID_HOME and edit it so it looks like this
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
After you changed them, do source .bashrc or source {whatever file they're on} and it should work (it works on the terminal you did it, it, do it in whatever terminal you want it to work, if it's on .bashrc it'll work next time you restart without doing source)
That's how it's done if Android is installed in ~/ (you can check out by doing cd, and then ls, Android should appear, if it didn't, change $HOME for the direction of where you installed it).
If you don't have those variables at all: just open ~/.bashrc and add them to the file. And do the same as it's explained before.
And yeah, that's it. I'd appreciate if someone translated this to the Windows and Mac way.
Related
Full error:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\romario\git\trials\meo\platforms\tempPlugin\core\build.gradle' line: 6
What went wrong:
A problem occurred evaluating root project 'core'.
Failed to apply plugin 'com.android.internal.library'.
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 1s
Failed to build plugin #nativescript/core :
Error: Command gradlew.bat failed with exit code 1
notes
I am running java 11
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?
After the update of my Flutter project to JAVA 11 suddenly I got this error when I try to run the app on any device.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileQa4DebugJavaWithJavac'.
> Could not resolve all files for configuration ':app:androidJdkImage'.
> Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JdkImageTransform: /Users/enzoftware/Library/Android/sdk/platforms/android-30/core-for-system-modules.jar.
> jlink executable /Applications/Android Studio Preview.app/Contents/jre/jdk/Contents/Home/bin/jlink does not exist.
* 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 56s
Exception: Gradle task assembleQa4Debug failed with exit code 1
I tried doing flutter clean, install again the SDK for API 30 and reinstalling everything from scratch but the problem persist.
Any suggestions are welcome.
Change version of JAVA 8 because JAVA 11 isn't good for using Flutter. I was on sam
I'm trying to create my APK app but it fails and prints this error in android studio terminal:
C:\flutter\bin\flutter.bat --no-color build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: E:\flutter\2021\my_flutter_app\build\app\intermediates\flutter\debug\libs.jar.
> Transform's input file does not exist: E:\flutter\2021\my_flutter_app\build\app\intermediates\flutter\debug\libs.jar. (See https://issuetracker.google.com/issues/158753935)
* 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 9m 19s
Running Gradle task 'assembleRelease'... 562.4s (!)
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
in the debugging mode the app work!!
I hope you can help me with the solution to fix the error
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