Could not install app on device, react-native - node.js

I am extremely new to app development. I am facing the following error during the installation of my app on emulator by using the CLI:
Error Message on the Terminal:
Following are the details of my project:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
I don't know what is causing this, and I have tried deleting the gradle (version 2.14.1) multiple times and zipping it again inside the 'gradle' folder. Still It does not seem to be resolved.
How can I solve the problem?

I have the same problem as yours! Because when I first run "react-native run-android", my INTERNET is SLOW and LAG, CORRUPTED. This bad internet connection lets to download a TEMPORARY DAMAGE file gradle....zip.
Solution: The gradle-2.14.1-all.zip was damaged,so it should be replaced with a new gradle-2.14.1-all.zip
Then go to android folder of your react native application
./gradlew clean
Try running the application again

Related

Error on Android Studio emulator: Could not connect to developer server - React Native

I'm new to react native. Recently I started to have this error on Android Studio emulator "Could not connect do developer server". Also see the screenshot to the error on the emulator. The error appears each time I try to reload the page to see the changes made on Visual Code, pressing "R,R". Does anyone have already face and fix this error successfully?
Here is what I tried so far:
Installed Metro and added the folder "assets" in in metro-config
Verified that the emulator is connected to the wifi, airplane mode is disabled
Added the port "localhost:8081" in the Dev setting
Downgraded Node.js from the latest version 16.14.2, to and older one 14.17.4 and then tried 14.16.1. It still didn't work, even after I restarted the laptop
Closed everything and run the command "react-native run-android" again, still get the error when I reload the emulator...
Any idea on the cause of this problem and how to fix it?
Thanks in advance.

React-native Task :app:processDebugMainManifest FAILED

When I'm creating a new react-native app, then trying to run it on android emulateur, I'm getting this error. I tried all the solutions offered on google but without success... I followed all the documentation and started all over again several times but still this problem.Here are the screenshots of my info :
I found the solution ! (Windows)
Steps one : Go to C:\Users\yourname.gradle and delete all folders.
Step two : Check that the anti virus is not in silent mode (very important)
Step tree : Create your new project : npx react-native init myAwesomeProject and authorize every file catch by the anti virus ! Then it will work.
If still doesn't work, open in android studio the android folder of your project, let it build everything, start your project from a terminal and run the project from your android studio application.

"APK was defined multiple times" , app fails to install with Android Studio

My app was installing just fine... installing and reinstalling for testing, etc. But now it won't install anymore... and Android Studio says,
Application Installation Failed
Installation failed with message Failed to
finalize session :
INSTALL_FAILED_INVALID_APK: Split
lib_slice_3_apk was defined multiple times.
It is possible that this issue is resolved by
uninstalling an existing version of the apk if it is
present, and then re-installing.
WARNING: Uninstalling will remove the
application data!
Do you want to uninstall the existing
application?
[CANCEL] [OK]
I tried uninstalling the app from my phone, but it still won't re-install.
Also, I tried installing it fresh on an emulator where it had never been installed before, and that did not work either.
I suppose I must have inadvertently messed up some compile-related setting that I don't understand (but I haven't been doing anything like that). I don't have a knowledge of the compile process, and pretty much depend on Android Studio to do that.
I have been working on a "sister" app to this one... where I copied some libraries (.jar files such as zixng.jar from [project root]\app\libs) from this app to the other app. And that other app is installed on my phone also... but then again, it's not on the emulator... so I guess that's not the problem. Merp.
Thanks for any suggestions or possible explanations.
Try to clean & then Rebuild the project again. To do so please go to Build menu, both the tools are present their.
If issue not solved with that than try to invalidate caches & restart Android Studio from File menu -> Invalidate Caches/Restart.

VS 2015 TACO - build broke on Xcode 8 / iOS 10

Here are the issues I encountered and fixed:
Code signing: downloaded the xcode8.js hook and added the following to build.json, per http://www.dpogue.ca/articles/cordova-xcode8.html:
"ios": {
"debug": {
"developmentTeam": "VZ4B5XSP9U"
},
"release": {
"developmentTeam": "VZ4B5XSP9U",
"codeSignIdentity": "iPhone Developer"
}
}
On my Mac, deleted the ~/.taco_home/node_modules/taco-remote-lib/2.2.1 and .../2.2.0 folders, per https://github.com/Microsoft/remotebuild/issues/5.
On my Mac, tried uninstalling and reinstalling remotebuild, and different versions of node and npm (0.12.9 and 4.6, and respective npm versions).
In Visual Studio, tried changing the targeted Cordova version: 6.3.1, 6.2, 6.1.1, and back to 5.4.1.
No matter what I do though, the build gets stuck either on extracted - Extracted app contents from uploaded build request, or building - Updating platform forever.
Earlier, when I tried opening the Xcode project in Xcode on the Mac, it successfully built and deployed the app to the device. I was then facing issues using WebRTC (using cordova-plugin-iosrtc) and it was giving me privacy violation exceptions. I tried adding the cordova-custom-config plugin and appropriate Cocoa keys (NSCameraUsageDescription and NSMicrophoneUsageDescription) per App crashes with __CRASHING_DUE_TO_PRIVACY_VIOLATION__ when trying to access contacts, and then it stopped working altogether.
Can anyone please advise what are the latest versions of all of the components I should be using to make it work again? Some sources advise to use Node 0.12.9 on the Mac, others 0.12.7; most people claim that with Cordova >= 5.3.3, any Node version should suffice, however using Node 4.6 didn't work either.
Thanks in advance for any help!
Update: After performing the brew update etc. as suggested by Jordan, the remote deploy works, but the build sets "Main interface" setting under project's General tab to "NSMainNibFile~ipad", which causes the app to crash on launch, until I open the project in Xcode and clear that field, then an incremental build creates a functioning app.
This is a known issue with Apache Cordova 6.3.1 and for the Visual Studio tools we've been working on a fix for this. To work around the issue for now, you'll need to perform the following steps:
Add a developmentTeam property to the ios build settings in your project's build.json file (an example is shown below).
Set the build.json file's codeSignIdentity property to the static value iPhone Developer.
Setup a before_compile hook in your project to copy the developmentTeam property into the project's platforms/ios/cordova/build.xcconfig file.
The project's build.json file should look something like the following:
{
"ios": {
"debug": {
"developmentTeam": "DEVELOPMENT_TEAM_NAME"
},
"release": {
"developmentTeam": "DEVELOPMENT_TEAM_NAME",
"codeSignIdentity": "iPhone Developer"
}
}
}
To simplify the process, Darryl Pogue published a sample hook that makes the required changes to the project's build.xconfig file based on the build.json example shown above. To use this hook, copy the sample xcode8.js file to your project's hooks folder, and then modify the project's config.xml to execute it before the compilation step using the following code:
<platform name="ios">
<hook type="before_compile" src="hooks/xcode8.js" />
</platform>
Creating a Distribution Build
At this point, the Cordova build process works, and you can run, test and debug your app. Unfortunately, the app isn't being signed with the correct development certificate needed for distribution. In order to sign them with a distribution certificate, you'll need to create an archive of the app by following the instructions found in: Uploading Your App to iTunes Connect.
iOS 10
Developers building Cordova applications for iOS 10 may encounter the following errors:
Http 404: Error mounting developer disk image
Http 500: No devices found to debug. Please ensure that a device is connected and awake and retry.
This is caused by the Mac development environment needing an update to several modules. To fix the issue, on Mac OS, open a terminal window and issue the following command:
brew update && brew upgrade libimobiledevice --HEAD && brew upgrade ios-webkit-debug-proxy ideviceinstaller

Cannot run the same App that used to run fine

I am creating universal Windows App using Visual Studio 2015. The App initially run fine but then something happen and App failed to been deployed. I just get following error.
I have tried uninstall the App, cleaning the bin and bld directories (even removing these), changing the package name (guid and display name) but nothing works. Any ideas on what cause this error and how to resolve it?
EDIT
Events Viewer is showing following entry.
ActivateApplicationForContractByAppIdAsUserWithHost of the app
0c2164b1-2ddd-4cef-9305-f061db235a23_nef0eajndckej!App for the
Windows.Launch contract failed with Install failed. Please contact
your software vendor..

Resources