installing phonegap on Windows 7 home premium issue - android

I've been trying to install phonegap on my Windows 7 laptop for the past couple days and I can't seem to get pass a specific error.
14828 error Error: EPERM, open 'C:\Users\MyUserName\AppData\Roaming\npm\node_modules\phonegap\node_modules\phonegap-build\node_modules\phonegap-build-api\node_modules\request\node_modules\form-data\node_modules\combined-stream\node_modules\delayed-stream\test\integration\test-max-data-size.js'
npm ERR! Please try running this command again as root/Administrator.
What I've tried so far
tried running 'npm install -g phonegap' on both node.js x86 and 64bit
running installation as admin (right click cmd -> run as admin)
The error message is telling me I'm missing test-max-data-size.js in the path
When I go to the that folder, I do see other scripts (like test-handle-source-errors.js and test-delayed-stream.js) ... but not tast-max-data-size.js
The error suggests me to run as Administrator but I am already am ...
Is there anything I can try to further throubleshoot this issue?

Related

ionic cordova run android fails at invalid adb location?

I'm trying to get a brand new set up in place to run the example Ionic 4 app on an android device. I'm running on a brand new iMac and have installed all the needed prerequisites (ionic cli, npm, JDK8, Gradle, Android SDK, set up environmental variables, etc.) All latest version, fresh install.
I'm able to create the example app, add android platform, and build fine. But when I try to run to a device I get this error:
cordova build android
native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug.apk --forward 8100:8100
[native-run] Error: spawn /Users/mike/Library/Android/sdk/platform-tools/adb ENOENT
[native-run] at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
[native-run] at onErrorNT (internal/child_process.js:469:16)
[native-run] at processTicksAndRejections (internal/process/task_queues.js:84:21)
[ERROR] An error occurred while running subprocess native-run.
What concerns me is the file path shown (.../sdk/platform-tools/adb) is different from where I see the location when navigating there myself (i.e. the fresh install of Android Studio has this at the location .../sdk/platform-tools/platform-tools/adb .... (note the extra "platform-tools" folder.
When I run "adb devices" it works, but only when I have the environmental variable (PATH) set to .../platform-tools/platform-tools/adb but when I try the ionic run command its obviously trying the other location. How? Why? What did I install wrong???
After much toiling... final step was to completely uninstall and remove all components of Android Studio, then reinstall again. This solved it and removed the duplicate folders. No idea how it would have happened on a standard install but if anyone else experiences it, this would be my recommendation.

React-native does not find Genymotion

I installed android studio, I configured the environment variables and everything, I installed genymotion and created a device, but running the react-native run-android in the project folder occurs the following error:
error 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
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.
please help me in this problem. React-native does not find Genymotion disositivo, in this link has more details: https://pt.stackoverflow.com/questions/382115/react-native-n%C3%A3o-reconhece-genymotion
It tries to connect the emulator to the ADB, by the IP of the device. To check the IP of the device, simply click on an emulator window, the IP address is in the title of the window.
No terminal will run the command:
$ adb connect ip_of_your_emulator:5555
Soon after, run:
$ adb devices
If the name of your file appears in the list, your emulator has been connected successfully!
With the emulator open, simply run the native run-android in the folder of your project.
I've had the same problem earlier this month. As far as I can tell the newer versions of Genymotion don't register on adb devices, a user in the Expo forums speculates it's because they have a paywall now.
I recommend switching to Android Studio, that's what I did to solve my problem.
I ran react-native with the --verbose flag, and got the following error:
...
error Failed to install the app. Make sure you have the Android development
environment set up: https://reactnative.dev/docs/environment-setup.
Error: spawn ./gradlew EACCES
...
So, I gave permissions to the android/gradlew folder as follows:
chmod 755 android/gradlew
But then, I got an error regarding Google Play Licenses:
error Failed to install the app. Please accept all necessary Android SDK
licenses using Android SDK Manager: "$ANDROID_HOME/tools/bin/sdkmanager --licenses".
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
So yeah, pretty the solution was:
Downloading Android Studio with its own SDK
Change the env variabe ANDROID_HOME to the one installed with Android Studio
Installing Google Play Licensing Library (In Android Studio, go to Settings>SDK Manager>SDK Tools, select Google Play License Library and then install)

ReactNative build for android just freezes over the last step

I was developing a React Native project as always; when I encountered the following error after doing react-native run android or equivalently cd android && ./gradlew installDebug.
It's just over the last step that this exception is caught:`
:app:assembleDebug
:app:installDebug
Exception in thread "Device List Monitor" java.lang.NullPointerException
at com.android.ddmlib.EmulatorConsole.checkConnection(EmulatorConsole.java:317)
at com.android.ddmlib.EmulatorConsole.getConsole(EmulatorConsole.java:231)
at com.android.ddmlib.DeviceMonitor.queryAvdName(DeviceMonitor.java:248)
at com.android.ddmlib.DeviceMonitor.updateDevices(DeviceMonitor.java:220)
at com.android.ddmlib.DeviceMonitor.access$400(DeviceMonitor.java:65)
at com.android.ddmlib.DeviceMonitor$DeviceListUpdateListener.deviceListUpdate(DeviceMonitor.java:662)
at com.android.ddmlib.DeviceMonitor$DeviceListMonitorTask.processIncomingDeviceData(DeviceMonitor.java:847)
at com.android.ddmlib.DeviceMonitor$DeviceListMonitorTask.run(DeviceMonitor.java:781)
at java.lang.Thread.run(Thread.java:745)
> Building 97% > :app:installDebug`
I'm coding on react-native version 0.43.2 and react-native-cli 2.0.1, also npm 4.1.2 and yarn 0.21.3; Ubuntu 16.04. So everything is armed to teeth by the latest version but I still can't figure out the problem. It happens even for a project I just create by react-native init, it's every where. :(
P.S. be sure my emulator is up and running and the problem isn't due to it.
Try restarting adb in to make it probe the local 5554 port
killall adb; adb devices
Actually, I never found the reason or the solution to the problem. But what I know, I went on with my daily work, and after a day or two (with a couple of restarts in this period) it began working again. And till now, I haven't encountered the problem again.
try to specify the path for sdk/build-tools in the terminal
export PATH="Users/YOURUSERNAME/Library/Android/sdk/build-tools/...":$PATH
after that restart the emulator and try
npm run android
The fix I have found that works for me is to:
Close the emulated device so you have nothing listed when running adb devices
Run react-native run-android so the build fails correctly with a No connected devices! error
Restart the emulator and run react-native run-android again
Unfortunately I still have to run this after every restart, would love to get to the root cause and fix it once and for all!
If you had hit the following error while installing watchman, you will most likely hit the issue mentioned in this discussion
Warning: The post-install step did not complete successfully
If this is the case, check what the watchman window shows. If it is something like this:
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2018-08-24T17:37:44,142: [0x7fffab20d380] while computing sockname: failed to create /usr/local/var/run/watchman/macbookpro-state: No such file or directory
Do
> brew uninstall watchman
> cd /usr/local/var/
> sudo chown -R $(whoami) var
> brew update
> brew install watchman
Kill/close the emulator device and run the command
> react-native run-android
You should see the action fail with message like
> com.android.builder.testing.api.DeviceException: No connected devices!
Now, rerun the command to see the compilation successful and the app opening up in the emulator
> react-native run-android

Cordova CLI command returns nothing even "cordova --version", installation issue?

Recently, I needed to try developing a cordova application. I installed android studio with no problem. Then I went on for Nodejs. I got Nodejs 6.0 installed on my Windows 7 system.
It worked fine. Then I tried to install cordova
with npm command :
npm install -g cordova
It seemed finally ok. The verbose message appeared and the graphical text displayed the folder structure of the installed components, which I thought, this tells me the success install.
When I typed node --version, it showed 6.0.0, the nodejs has been installed correctly.
Then I typed npm --version, it showed 3.8.8. So npm works ok.
After that, I typed cordova --version to validate the installation, it seemed to fetch something for a little while and return the prompt without printing anything or even its version.
I took another try, I typed cordova help. Same thing, there's nothing happen. It just failed or got error somehow silently.
I removed cordova with npm uninstall -g cordova, and tried install again to eventually get the same result. I even tried to remove nodejs and re-install all over again but no luck.
Is there anyone out there faced the same to me? And how did you solve this problem? Any idea?
Make sure this is in your System Path (under : PC -> Properties -> Advanced System Settings -> Environment Variables)
C:\Users\ Your User \AppData\Roaming\npm
Try to close and re-open your command prompt ;)

Problems getting Android Studio to build and install project on Ubuntu

When I go to install the packages from with Android Studio I get a "ADB not responding" error with wait/restart/close options.
I can run adb from a term. I can see my device and install the apk from the cmd line, but it doesn't work from within Android Studio.
In the terminal (that is running Android Studio) I get the following
03:56:36 E/adb: Unexpected exception 'Cannot run program "/media/5b317046-147a-42ee-aec1-f73caf1922c5/home/kloud9/WorkSpace/downloads/workspace/android-studio/sdk/platform-tools/adb": error=13, Permission denied' while attempting to get adb version from '/media/5b317046-147a-42ee-aec1-f73caf1922c5/home/kloud9/WorkSpace/downloads/workspace/android-studio/sdk/platform-tools/adb'
I have tried running Android Studio as sudo, but that doesn't help. I have all the environment variables set correctly, I am running oracle sun java jdk1.7.0. Any thoughts on what to try next?
Thanks,
Joe
I had the same issue. This fixed it for me.
sudo apt-get install ia32-libs

Categories

Resources