react-native run-android issue on Windows 10 - android

I've developed an app using Create-React-Native-App and usually would test the work using 'npm run android' where Expo client is installed on my device which would load the app once my laptop and mobile is on same WiFi network.
When I used create-react-native-app, the directory structure it laid down looks like this (src directory is created by me):
appDirectory\
--.expo\
--node_modules\
--src\
--.bablerc
--.flowconfig
--.gitignore
--.watchmanconfig
--.App.js
--app.json
--App.test.js
--package.json
--README.md
--yarn.lock
Now that I am done developing the app, I tried running this command: react-native run-android to install an APK to my device and create environment for both Android and iOS with their respective entry points like index.android.js/index.ios.js but I don't see any of this and all I get as output is:
Scanning folders for symlinks in D:\ROHIT\Projects\appDirectory\node_modules (141ms)
Please help me out with this as I am pretty new to React-Native and unable to understand to generate APK for testing and production, to be installed on various devices for pilot testing
Thanks and best,
Rohit

Related

React Native: Build APK that can connect to development server

I have an interesting scenario. It was an expo project that I converted to react-native. I don't have a react-native command (but can run npx react-native, but my understanding is to build the test APK I run yarn android which actually runs expo run:android.
However, my dev server is remote, so I'm looking to generate an APK and then use the developer menu to set the IP address of the dev server on the device, then connect to the react native server (i.e. not using Expo anymore)
How do I go about building this APK? When I use yarn android it says there are no devices connected and won't build.
Thanks!
npx react-native run-android builds an APK in ./android/app/build/outputs/apk but then fails. Just install this APK, then run it, shake the device to get the menu to pop up (or Cntrl-M for the menu on an emulator), settings, and dev server info is there (port 8081 default).

running mapbox.js cordova application on mobile device

when i run the mapbox.js example in my cordova application using visual studio, it running and display the map correctly in visual studio emulator "simulate in browser-Nexus 4", if i run the same application apk file in my mobile device map is not loading.
The difference seems to be, in the example page on both, that the mapbox doesn't take up any difficulty in loading the map. The issue only appears to be an issue when running mapbox on mobile devices.
I got a solution for this question...
If we face the above problem means, we can install whitelist plugin with Cordova CLI, from npm. In the Command Prompt, change directories to the "(your cordova project\bin)" folder
(For example:C:\Users\user\Documents\Visual Studio 2017\Projects\DemoProject\DemoProject\bin )
and run the following command.
$ cordova plugin add cordova-plugin-whitelist
$ cordova prepare
By using this, we can easily run the cordova.apk in our mobile devices

Ionic App not installing in android device

I am a newbie in Ionic. I just made a simple app in Ionic that ran well on browser. So, I converted it into an .apk file using Android studios that generated an android-release-unsigned.apk file. I transfered it to my device and on trying to install it I encountered that it was not being installed. I am not able to figure out the cause. Need some assistance.
You can follow the steps which are mentioned in the official doc below.
Deploying to a Device
But for me, it didn't work.So I just manually did that as shown below.
ionic cordova run android --device
Plugged device to the PC using USB
Copy the android-debug.apk file to the device (apk path:.. \platforms\android\build\outputs\apk)
After that, You have to enable below setting on your Android device
settings --> general tab --> security --> unknown sources (enabled this)
After that just double-clicked the android-debug.apk from the location which you have copied.Then your app will be installed on your device.That is it.You can use your app on real device now.
The most probable reason I can think of is that your application is not signed. As Sampath mentioned try to build a debug version and not release version of your application and then install it on your device. You can can use 'ionic run android' and copy/paste manually the output android-debug.apk file to your device.
In the config.xml, in the 2nd line, there is a tag called widget. You have to give a unique id for that. If there is another ionic app installed with same widget id, your device will not allow you to install another app with the same id.
$ adb devices
native-run android --app platform/your-app-debug-link.apk --device

Ionic Build or Ionic Run builds the wrong app

I am trying to build or run an Ionic Cordova App. But it always builds a default app with playlists.
OS is Windows 10
I do the following from my command prompt:
c:\users\martijn\documents\ionic start testapp blank
c:\users\martijn\documents\testapp\ionic run android
now it is building a different app then in my app directory. When I do ionic serve I see the right app in my browser. Can't figure out why running or building gives me a different app, I think it is a default example app.
Can somebody help?
See link here:
https://github.com/driftyco/ionic-cli/issues/1283
Appears you may have to delete the the last apk file from platforms\android\build\outputs\apk

Cordova project running on Android and on iPad, but not on iPhone

I have a Cordova project, that I can run on my Android phone using ionic run android --device and on my iPad using ionic run ios --device. However, now I connect my iPhone 5, and run the last command again, but get the following error message.
...
[ 60%] TakingInstallLock
[ 65%] PreflightingApplication
[ 65%] InstallingEmbeddedProfile
[ 70%] VerifyingApplication
2015-06-24 17:58:48.564 ios-deploy[33436:1048931] [ !! ] Error 0xe8008015: ∑~}ˇ AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)
Error code 253 for command: ios-deploy with args: -d,-b,/path/to/project/App/platforms/ios/build/device/project_name.app
ERROR running one or more of the platforms: Error: /path/to/project/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
Online (also on SO) I find many users facing this issue with an Android device, and then they need to install the Android APK. I also read here that I have to run the following command first: sudo npm install -g ios-deploy, which I did. It did not help though.
I am using version 5.0.0, and I read here that I have to downgrade to version 4.3.0. I find this hard to believe though. Is there another cause for this error? How can I check for it, and how can I solve it?
I encountered the same ios deploy AMDeviceSecureInstallApplication error when deploying to a new ios device. Here is how I was able to resolve it and successfully deploy to the new ios device. Start xcode and open your xcodeproj file which can be found in your project_name/platforms/ios directory. Once the project is finished loading then from the top menu select Product and then select destination and choose your new ios device. Then when you click run in xcode you will be prompted that it cannot run on the new ios device because of your code signing provisioning profile. There will be an option that says something like "try and fix it" and simply select that option and follow the prompts, confirm which provisioning profile you want to use to deploy your app to the device. If you only have one provisioning profile then select that one and the app will now run on your device. And in the future you should be able to deploy to this device using the ionic run ios --device command.

Categories

Resources