Running React-Native App locally (FB F8 App) - Build Failed Error - android

I am trying to run a the react-native app that was used at F8 locally. I am following the instructions here: http://makeitopen.com/tutorials/building-the-f8-app/local-setup/
I have everything work correctly (I can go to http://localhost:8080/dashboard/apps and http://localhost:8080/graphql and see data and run queries)
However, when I try to run the builds for iOS and Android, I am running into errors.
Android Error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/thisuser/f8app/android/app/build.gradle' line: 124
* What went wrong:
A problem occurred evaluating project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* 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: 1 mins 4.006 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
iOS Error:
=== BUILD TARGET CodePush OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
** BUILD FAILED **
The following build commands failed:
CompileC /Users/thisuser/f8app/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/react-native-fbsdk.build/Objects-normal/x86_64/RCTConvert+FBSDKSharingContent.o /Users/thisuser/f8app/node_modules/react-native-fbsdk/iOS/RCTFBSDK/share/RCTConvert+FBSDKSharingContent.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/F8v2.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/done.js:10
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/F8v2.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:464:13)
at Object.execFileSync (child_process.js:484:13)
at _runIOS (/Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:82:32)
at /Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:24:5
at tryCallTwo (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (/Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:23:10)
at Object.run (/Users/thisuser/f8app/node_modules/react-native/local-cli/cliEntry.js:96:13)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)
How do I make these work?

For android only
You will need to set Android SDK path like this and must have at least Android SDK Build-Tools Rev 23.0.1.

Related

SDK Location not Found In Gradle Command Line Linux

I am trying to build my project using fdroid but it keeps failing when it gets to gradle. The project builds well in android studio but it always fail in gradle command line. I have search google multiple times but i could not get help from any website. I have set my ANDROID_HOME to /home/collins/Android/Sdk but it seems gradle ignores the variable, Each time i try to build, i noticed that gradle generates a local.properties file with the wrong sdk location value:
sdk.dir=$ANDROID_HOME
sdk-location=$ANDROID_HOME
I don't know if there is a way to set the global default value for any project in gradle. Here is the full log from fdroid build
INFO: Building version 3.0 (3) of com.simpledecredwidget
INFO: Getting source for revision 0ca18981c4b3825861b07e1f2444f711fc8a4fa5
INFO: Creating local.properties file at build/com.simpledecredwidget/local.properties
INFO: Creating local.properties file at build/com.simpledecredwidget/app/local.properties
INFO: Cleaning Gradle project...
ERROR: Could not build app com.simpledecredwidget: Error cleaning com.simpledecredwidget:3.0
==== detail begin ====
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /home/collins/Documents/Projects/fdroiddata/build/com.simpledecredwidget/app/$ANDROID_NDK.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory '/home/collins/Documents/Projects/fdroiddata/build/com.simpledecredwidget/$ANDROID_HOME' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
==== detail end ====
INFO: Build for app com.simpledecredwidget failed:
Error cleaning com.simpledecredwidget:3.0
==== detail begin ====
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /home/collins/Documents/Projects/fdroiddata/build/com.simpledecredwidget/app/$ANDROID_NDK.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory '/home/collins/Documents/Projects/fdroiddata/build/com.simpledecredwidget/$ANDROID_HOME' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
==== detail end ====
INFO: Finished.
INFO: 1 builds failed
EDIT
As you can see in the error above, The sdk location /home/collins/Documents/Projects/fdroiddata/build/com.simpledecredwidget/$ANDROID_HOME was used which was incorrect, i don't know where this bug is coming because a different value was set in local.properties file which value is sdk.dir=$ANDROID_HOME

react native run android in emulator throws erro

i install react native and open a new project.
i try to run
react-native run-android
and I get this error
PS E:\Projects\React native\myapp> react-native run-android
Scanning 574 folders for symlinks in E:\Projects\React native\myapp\node_modules (27ms)
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 'E:\⌠°σΘΘ≈ΦΘφ\⌠°σΘΘ≈ΦΘφ ≈Θ⌡\React native\myapp\android\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.
* 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.877 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
As you can see from the error you need to move your project to a different directory with no non-ASCII characters.
Your project path contains non-ASCII characters. This will most
likely cause the build to fail on Windows. Please move your project
to a different directory. See http://b.android.com/95744 for details

Ionic build android : Errors during XML parse: javax.xml.bind.UnmarshalException

I created a simple ionic app and when i try to build the android app using
ionic build android
I come across this error:
Parsing C:\Users\myuser\AppData\Local\Android\Sdk\tools\package.xml
Errors during XML parse:
javax.xml.bind.UnmarshalException
- with linked exception:
[java.net.MalformedURLException]
Additionally, the fallback loader failed to parse the XML.
Failed to download any source lists!
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Failed to find Build Tools revision 23.0.3
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
My android SDK is fully installed.there is the SDK Manager:
Is there any idea what can be wrong? I'm using Windows 10 64-bit Operating System and all the environment variables is already set:
and

Ionic Build android Error with Exit code 1

BUILD FAILED
C:\Program Files\Android\Sdk\tools\ant\build.xml:716: The following error occurr
ed while executing this line:
C:\Program Files\Android\Sdk\tools\ant\build.xml:730: Compile failed; see the co
mpiler error output for details.
Total time: 2 seconds
F:\todo\Ionic\Teller\src\platforms\android\cordova\node_modules\q\q.js:126
throw e; ^ Error code 1 for command: cmd with args:
/s,/c,ant,debug,-f,F:\Verifast\Ionic\Te
ller\src\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-
gen ERROR building one of the platforms: Error: cmd: Command failed
with exit code 1
You may not have the required environment or OS to build this project Error: cmd: Command failed with exit code 1
Please help
try running the android tools and installing the items below:
Open the SDK manager.
You will require:
1. "SDK Platform" for android-23
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
cordova platform update android
will fix the error. Cordova is always one behind the android version eg if we have android API 24 then we have cordova 5.x.x supporting upto API 23. Hence any project is build using API 24(eg. using Android Studio) will show this error.
For better understanding I have posted error that I got:
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugApk'.
A problem occurred configuring project ':CordovaLib'.
Could not resolve all dependencies for configuration ':CordovaLib:classpath'.
Could not find com.android.tools.build:gradle:2.2.3.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
Required by:
android:CordovaLib:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

ionic build android FAILURE: Build failed with an exception. Could not create an instance of type org.gradle.invocation.DefaultGradle_Decorated

I created an Android platform with success, but when I run
ionic build android
I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not create an instance of type org.gradle.invocation.DefaultGradle_Decorated.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
ERROR building one of the platforms: Error code 1 for command: /home/skylek/Ionic/conFusion/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/skylek/Ionic/conFusion/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /home/skylek/Ionic/conFusion/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/skylek/Ionic/conFusion/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
Can anyone help me out.
I had exactly the same problem with an ionic project build with the m-ionic yeoman generator, that was uploaded to the ionic cloud.
It started after my computer crashed with a 'blue screen of death', in the middle of a compilation task
What We did to fix the project was to copy and replacing the gradle and corodova files :
.gradle
cordova
CordovaLib
gradle
gradlew.bat
from other ionic>platform>android project that I knew was working fine, beacuse we thought the Cordova files might be corrupted, and early in the project we fixed a similar compilation problem that way. It did not fixed the problem. But then removed the ionic cloud configuration files: ionic.project .
And it worked!!
I hope it could help you!

Categories

Resources