Detox build with Expo - "Error: Could not find build script in detox.configurations["ios.sim"].build" - react-native

Goal:
I would like to be able to run detox tests for an expo app with Travis.
I created a bare-bones expo app that successfully runs a single detox test on my local machine. After pushing to git and running on Travis, all dependencies install successfully and then the Travis build scripts fail with the following error.
Error:
Error: Could not find build script in detox.configurations["ios.sim"].build
Issue:
It looks like the issue occurs because there isn't a "build" entry in the "ios.sim" configuration for "detox" in package.json. For a non-expo React Native project with detox, the corresponding .xcodeproject or .xxworkspace can be built directly. Expo doesn't have a .xcodeproject or .xcworkspace - what to put for the "build" configuration for an Expo project? While there is an Exponent.the app provided by the expo to run tests with detox, I don't see any .xcodeproject or .xcworkspace to build with.
Repro steps:
Clone git#github.com:bryanboyko/expo-detox-travis-3.git
cd expo-detox-travis-3
npm install
./setup.sh
detox test
push to a new branch and create a PR to see travis build
Travis failure log:
https://travis-ci.com/bryanboyko/expo-detox-travis-3/builds/151879107

Related

couldn't initiate a new react-native app because iOS environment is not properly set

first time Mac user trying to start a new react-native application. After doing this:
npx react-native init project_adji --template react-native-template-typescript
it fails with the following message:
✔ Downloading template
✔ Copying template
✔ Processing template
✔ Installing Bundler
✖ Installing CocoaPods dependencies (this may take a few minutes)
error warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
I updated the ruby via rbenv to the required version to reach this point (ruby 2.7.5). I couldn't find the exact issue with my setup.
Any tips?
I had exact the same issue here. After some research, I solved by following these steps:
gem uninstall cocoapods
sudo xcodebuild -license accept
Then created a test project to see where if everything works fine by following:
npx react-native init tempProject --skip-install
cd tempProject
yarn install
cd ios
bundle install
bundle exec pod install

Building and running a finished project on iOS

I have a project downloaded from GIT in React-Native
What steps should I take to run the application in Debug mode on iOS:
on Emulator
on my Device
Firstly, install the node_modules using npm or yarn as per the git project readme.
If your react native version is above 60, it get default cocoapods support. Move to ios folder and run pod install from commandline.
Now you have 2 options to run the project:
1. Navigate to ios folder and run the command 'react-native run-ios'.
2. Open Xcode,Navigate to ios folder and open projecname.xcworkspace file. You can see the run command on top-left of the IDE.

react-native run-android not working on ubuntu 16.04

i have a problem with react native in ubuntu, i have installed,
java jdk 8 (both javac --version) as well as echo $JAVA_HOME gives the proper output.
I have also installed android studio and set the android environment variables as well as the tools and echo $ANDROID_HOME gives output of the sdk location.
I have also installed gradle version 4.4.
I am unable to start the android app using react-native run-android. can any one let me know if i have missed something during installation.
And react-native as well as android studio works fine as I am currently using react-native start to start the metro builder as well as the other react-native cli commands. also android studio and gradle is also able to generate debug as well as release apks with no problems.
The error i get,
Scanning folders for symlinks in /home/igate-naveed/Documents/ReactNative/mobile-app-android/node_modules (16ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
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
First of all you need to create a project like this:
react-native init myProjectName
Then, start an emulator from Android Studio... Afterwards:
npm install && npm start
in your project directory, and from another terminal, inside your project directory, run :
react-native run-android
Is this working?
Instead of using the npm install manager, I used yarn and it worked for me. In your project directory, just do:
(project-directory)$ yarn
Update the gradle version.
Create new project:
react-native init projectname
Uninstall the npm pack.
Reinstall the npm pack again.
npm start
react-native start
react-native run-android

Nativescript vue, how to get the .apk file?

By following nativescript docs, installed all dependencies and tns doctor dont find any error.
and followed a tutorial and ran the following commands,
npm install -g #vue/cli #vue/cli-init
vue init nativescript-vue/vue-cli-template hello-vue
cd hello-vue
npm install
All sets fine and then i did my coding for an simple app then i ran below command:
npm run watch:android
This deploy the app in my connected android phone.
so my question is how can i get the apk file, so that i can send to another person?
Note: sidekick even not opening my folder. and when running tns build android shows No project found at or above 'C:\wamp64\www\newapp' and neither was a --path specified.
For building the apk for android, use the following command:
tns build android --release --key-store-path <path-to-your-keystore> --key-store-password <your-key-store-password> --key-store-alias <your-alias-name> --key-store-alias-password <your-alias-password>
Lots more info here : https://docs.nativescript.org/tooling/publishing/publishing-android-apps
If you want to get the debug apk using tns debug android --bundle, it will be located here :
<your project folder>/platforms/android/app/build/outputs/apk/debug/app-debug.apk
If you are having trouble running tns, install nativescript globally using:
npm i -g nativescript
And follow the simple prompts.
I'm not sure if this is what you're looking for (it sounds like you want a debug.apk instead of an output.apk), but you might want to look at the documentation for publishing an Android app.

how to run github project of react native

I'm getting an error while I'm doing react-native run-android
error:
Command `start` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.
Inside your root directory where package.json is placed along with other directories like android/ios, run the command npm install. Then run
react-native link (not compulsorily required, required in case there are third party libraries to be linked). Then run react-native run-android (supposing you don't have sdk path problem and you have an emulator running).
This is the most common way of starting a git project. Let me know if you face other problems.