mfp cordova run android error - ibm-mobilefirst

I'm getting this error when I try to run on android
mfp cordova run -d
mobilefirst-cli verb cli
process.argv=["/Applications/IBM/MobileFirst-CLI/IBMnode/bin/node","/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/bin/mobilefirst-cli.js","cordova","run","-d"]
mobilefirst-cli verb cli
opts={"debug":true,"argv":{"remain":["cordova","run"],"cooked":["cordova","run","--debug"],"original":["cordova","run","-d"]}}
mobilefirst-cli verb cli mobilefirst#7.1.0.00.20151130-1653
mobilefirst-cli verb cli node#v0.10.36 mobilefirst-cli sill
mfp_cordova_cmds running cordova command: "run" with args: ["-d"] ?
What platforms do you want to run on? android Searching for list of
Devices... ? Which device id do you want to target? 0815f84119921c04 -
Samsung RIL v3.0
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/rx-lite/rx.lite.js:75
throw e;
^ TypeError: Cannot read property 'length' of null
at ScreenManager.render (/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/mfp_cordova_cmds/node_modules/inquirer/lib/utils/screen-manager.js:64:52)
at Prompt.render (/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/mfp_cordova_cmds/node_modules/inquirer/lib/prompts/list.js:103:15)
at Prompt.onSubmit (/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/mfp_cordova_cmds/node_modules/inquirer/lib/prompts/list.js:116:8)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/rx-lite/rx.lite.js:1535:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext
(/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/rx-lite/rx.lite.js:1469:31)
at AnonymousObserver.tryCatcher (/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/rx-lite/rx.lite.js:63:31)
at AutoDetachObserverPrototype.nextohbocxxg5415yfv:kmf_cordova hannade$

Have you tried with a newer CLI build? I see the following is available: http://public.dhe.ibm.com/ibmdl/export/pub/software/products/en/MobileFirstPlatform/mobilefirst_cli_installer_7.1.0.zip
I have a slightly older build installed, 7.1.0.00.20151023-1449, and after creating a MFP Cordova app with the Android environment, I was able to successfully run it in the Android Emulator. I suggest that you will try with the above newer build.

I have the MFP CLI build version 7.1.0.00.20151227-1730 and command
mfp cordova run -d
runs alright for an emulator device, however for a physical device, I get the same error
TypeError: Cannot read property 'length' of null at ScreenManager.render (/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/mfp_cordova_cmds/node_modules/inquirer/lib/utils/screen-manager.js:64:52)
This appears to be an issue specific to using physical devices to run the cordova application.

This is a known problem in some versions of the CLI and the Foundation team just delivered a fix, which is now available on Fix Central.
Look for interim fix 7.1.0.0-MFPF-IF201602291240 or later and APAR number
PI56876. Please give it a look and let me know if it resolves this
problem.

Related

Getting Building iOS bundle error when trying to build an android app - expo -react-native

I was able to build app using expo build:android previously. However, after upgrading to latest expo version I get following error:
connect ECONNREFUSED 127.0.0.1:19001
Set EXPO_DEBUG=true in your env to view the stack trace.
I also see the following lines in the log:
Publishing to channel 'default'...
Building iOS bundle
I don't added ios to my app.json, I only need to build an android apk. To do that I use expo build:android -t app-bundle
I also removed package-lock.json and node_modules and run npm install, but I get the same error.
I run expo start on another cmd and then run expo build:android -t app-bundle still get same error
Also when I clear expo cache, see the following log:
Restarting Metro Bundler...
Starting Metro Bundler on port 19001.
Couldn't adb reverse: adb.exe: error: Invalid source port: 'undefined'
I had faced same issue myself and found the solution. Expo is looking for localhost:19001 which is not running. Just follow following steps and it should work as expected:
Run expo start no terminal and once it opens up the
browser where you will find this line written Starting Metro
Bundler on port 19001.
Now open another terminal instance and run expo build:android.

An error occurred while running ionic cordova build android

when build android app using ionic ionic cordova build android comment getting an error
You have been opted out of telemetry. To change this, run: cordova telemetry on.
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=...\AppData\Local\Android\Sdk (DEPRECATED)
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information
ionic cordova build android
ionic cordova build android
You have been opted out of telemetry. To change this, run: cordova telemetry on.
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=...\AppData\Local\Android\Sdk (DEPRECATED)
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
As of Cordova-Android 6.4.0, Gradle is now required to be installed to build Android.
When installing on Windows, you need to add Gradle to your path, (see
Setting Environment Variables)

Failed to load bundle - Could not connect to development server

I've been looking for a solution to this issue for a day now but couldn't fix it.
I have not used react native for a month when everything was working fine.
Now, if I try to run an existing project that used to work (react native 0.59.5) or a brand new project (react native 0.59.9) with the iOS simulator on my mac, I get the error:
Failed to load bundle - Could not connect to development server
Any idea how I can fix this?
Ok found the issue. Was thinking it might be watchman related issue and wanted to use the command brew reinstall watchmanto reinstall it. By running this command, I found an error
Error: Xcode alone is not sufficient on Mojave. Install the Command Line Tools: xcode-select --install
Looks like the command line tools for xCode was not available anymore.
I launched the command xcode-select --install and then reinstalled watchman just in case. It is now working!
Couldn't connect to development server error
This error is received when the metro bundler isn't running in port 8081. To start the bundler, from project folder run:
npm start
Now, try reloading your app (ctrl + R for iOS / r+r for Android).
Also, check your terminal in case the project failed initial build due to some error.

react-native-camera: sdk manager plateforms-tools 28.0.1 can't be installed

I'm trying to install react-native-camera. I'm on Ubuntu 18, Webstorm for IDE. Targeting Android.
For the Android SDK, I don't have a full Android Studio install. I've instead install only android-sdk and I'm using the sdkmanager. That works fine with my stub app, it compile and runs on Android with
react-native run-android
I've installed react-native-camera as a module with npm as per the indications:
npm install react-native-camera --save
react-native link react-native-camera
So far so good. It links. If I try to launch the app however (even before trying to actually use the camera), I get some warnings:
> Configure project :react-native-camera
Checking the license for package Android SDK Platform-Tools in /usr/lib/android-sdk/licenses
License for package Android SDK Platform-Tools accepted.
Preparing "Install Android SDK Platform-Tools (revision: 28.0.1)".
Warning: Failed to read or create install properties file.
WARNING: platform-tools package is not installed, and automatic installation failed.
So I've tried to install the platforms tools using the sdk manager & instructions provided here:
sdkmanager "platform-tools" "platforms;android-28"
Which yields:
Warning: Failed to read or create install properties file.
So I am guessing it really has to do with the sdkmanager...
Do I absolutely need 28.0.1 for react-native-camera? If so, how can I get around this issue with the SDK manager? I've tried various similar syntax for the install of the platform and it didn't work. I checked with sdkmanager --list that it's the proper name (seems to be). And if I go under android-sdk/platforms-tools all I see there is the adb file (or perhaps the install is supposed to just update that file?)
Silly me.
I needed to run the SDK manager as sudo. To do that:
sudo bash sdkmanager [installations args as per post above].
I will leave the post - I lost a ridiculous amount of time for that, hopefully it can help others....
And yes - if the platform-tools install has worked then under /platform-tools you should see a bunch of files, not just the adb one.

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.