FAILURE: Build failed with an exception. - React Native - javascript

I'm Testing My React Native Installation
First
react-native start
After That
react-native run-android
I Connected my Device to pc, But I have This Error:
Scanning 557 folders for symlinks in D:\Projects 2016\Web\Android\FirstApp\AwesomeProject\node_modules (15ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Projects 2016\Web\Android\FirstApp\AwesomeProject\android\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
* 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: 2.533 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

It seems to the issue related with this question.
And the react-native docs indicates that it requires latest version of JDK.
Update your JDK version to latest one.

Related

Unable to launch Nativescript App in iOS simulator

when I run tns run ios, i get the following error:
Unable to apply changes on device: E152B60E-D109-4BF3-A03A-F1DC42AB9252. Error is: Command xcrun with arguments simctl install E152B60E-D109-4BF3-A03A-F1DC42AB9252 /Applications/nativeOne/HelloApp/platforms/ios/build/Debug-iphonesimulator/HelloApp.app failed with exit code 1. Error output:
An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/dim/Library/Developer/CoreSimulator/Devices/E152B60E-D109-4BF3-A03A-F1DC42AB9252/data/Bundle/Application/51605A25-4EC5-4D66-9E5D-4EFE1F9632AF/HelloApp.app/HelloApp : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
Failed to chmod /Users/dim/Library/Developer/CoreSimulator/Devices/E152B60E-D109-4BF3-A03A-F1DC42AB9252/data/Bundle/Application/51605A25-4EC5-4D66-9E5D-4EFE1F9632AF/HelloApp.app/HelloApp : No such file or directory
I've tried everthing possible, re-installed node.
flushed my cache...
the simulator works fine with flutter apps.
Nativescript CLI works fine with Android emulator. The only prob;em is getting it gto work on ios one.
Please help

React-native Failed to process resources, see aapt output above for details

I need help with my first React-native app.
It generates
C:\Users\Bradburry\Downloads\Project Vlogee\Hasura>react-native run-android
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Configure project :app
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
C:\Users\Bradburry.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\eaf5e02e0fb5007b45b00a347d77a822\res\values-v24\values-v24.xml:3:5-157: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
C:\Users\Bradburry.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\eaf5e02e0fb5007b45b00a347d77a822\res\values-v24\values-v24.xml:4:5-135: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
C:\Users\Bradburry.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\eaf5e02e0fb5007b45b00a347d77a822\res\values-v26\values-v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
Failed to process resources, see aapt output above for details.
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 32s
13 actionable tasks: 3 executed, 10 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Ionic run app on device exit code 1

I've spent all day trying to fix this error, i have no idea why this happens. i can build both iOS and android, but when i try to run on device, both iOS and android Exit code 1, here the log
BUILD SUCCESSFUL
Total time: 21.515 secs
Built the following apk(s):
/Users/Jose/Desktop/smarket/platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=/Users/Jose/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Skipping build...
Built the following apk(s):
/Users/Jose/Desktop/smarket/platforms/android/build/outputs/apk/android-debug.apk
Using apk: /Users/Jose/Desktop/smarket/platforms/android/build/outputs/apk/android-debug.apk
Package name: io.ionic.starter
Error: Failed to install apk to device: [ 0%] /data/local/tmp/android-debug.apk
[ 2%] /data/local/tmp/android-debug.apk
...
[ 99%] /data/local/tmp/android-debug.apk
[100%] /data/local/tmp/android-debug.apk
/Users/Jose/Desktop/smarket/platforms/android/build/outputs/apk/android-deb
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova run android --device (exit code 1).

React-native: Can't build the android app

I am a newbie, just started dipping my toe in react-native. The first hello world app did run okay, as I started the second one I am getting this error:
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
*What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException:java.lang.RuntimeException:com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
* 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: 14.034 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
It looks like your app is now multidex, you can learn mor about here
To solve this, just enable multidexing on build.gradle:
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}

Red Screen React Native Reference Error : Can't find variable : _fbBatchedBridge

I followed the steps mentioned in following documents and everything runs perfectly.
https://facebook.github.io/react-native/docs/getting-started.html
https://facebook.github.io/react-native/docs/android-setup.html
https://facebook.github.io/react-native/docs/running-on-device-android.html
Now am trying to run the android app on my device but I get below error.
I tried following to resolve the issue:
react-native start > /dev/null 2>&1 &
adb reverse tcp:8081 tcp:8081
If I try to run without a server, bundle the jsfile into the apk by running:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
I get
I followed all the steps outlined in this question react native android failed to load JS bundle but still I am not able to resolve the issue.
I am using my smartphone's data plan on my OSX machine via hotspot. I entered my machine's IP address inet 192.168.43.14 along with port 8081 in the react-native developer setting.
Any idea what am missing here?
Device details:
OSX El Capitan 10.11.1
Nexus 5(Rooted) 6.0.1
Node - v4.2.1

Categories

Resources