Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install app on simulator #26158

Closed
AbhishekChourasia16690 opened this issue Aug 23, 2019 · 18 comments
Closed

Unable to install app on simulator #26158

AbhishekChourasia16690 opened this issue Aug 23, 2019 · 18 comments
Labels
Bug Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@AbhishekChourasia16690
Copy link

Hello All,

I have been facing below issue since past 3 weeks.

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 855 file(s) to forward-jetify. Using 6 workers...
info Starting JS server...
info Installing the app...
Downloading https://services.gradle.org/distributions/gradle-5.4.1-all.zip

Exception in thread "main" java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at org.gradle.wrapper.Download.downloadInternal(Download.java:67)
at org.gradle.wrapper.Download.download(Download.java:52)
at org.gradle.wrapper.Install$1.call(Install.java:62)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Exception in thread "main" java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at org.gradle.wrapper.Download.downloadInternal(Download.java:67)
at org.gradle.wrapper.Download.download(Download.java:52)
at org.gradle.wrapper.Install$1.call(Install.java:62)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)

at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (C:\React_Project\Signup\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\React_Project\Signup\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at then.result (C:\React_Project\Signup\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

PLEASE LET ME KNOW WHAT STEPS SHOULD BE TAKEN IN ORDER TO RESOLVE THIS ISSUE.

Thanks and Regards,
Abhishek.

@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Aug 23, 2019
@AbhishekChourasia16690
Copy link
Author

System Info:
OS: Windows 10
CPU: (6) x64 Intel(R) Core(TM) i5-8500T CPU @ 2.10GHz
Memory: 4.34 GB / 7.84 GB
Binaries:
Node: 10.16.3 - C:\Program Files\nodejs\node.EXE
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5692245

Steps to produce:
Run command ''react-native run-android"

Error_React_Native

Let me know if you require any other information apart from this.

Thanks and Regards,
Abhishek

@AbhishekChourasia16690
Copy link
Author

Hello Team,

Could you please provide the solution for MAC. Below are the details:

OS: macOS 10.14.5
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 9.65 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash

Binaries:
Node: 10.16.3 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
npmGlobalPackages:
react-native-cli: 2.0.1

Steps to produce:
Run command ''react-native run-android"

Screenshot 2019-09-09 at 10 34 41 AM

@0xinhua
Copy link

0xinhua commented Sep 9, 2019

Hi @AbhishekChourasia16690,from this failed log image, It looks like your MacOS Android sdk environment is not ready:

  1. Configure the ANDROID_HOME environment variable, The React Native tools require some environment variables to be set up in order to build apps with native code.

  2. Add the following lines to your $HOME/.bash_profile or $HOME/.bashrc config file:

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
  1. source $HOME/.bash_profile to load the config into your current shell.

@AbhishekChourasia16690
Copy link
Author

Hello @kevin,
I executed the first step correctly.
But when I did the second step I failed coz once I created a new file in TextEdit and pasted the text as per you mentioned and tried pasting in home folder it didn't happen

Could you provide me links or mention steps how to perform second step
And please elaborate the 3 step you mentioned I couldn't understand much from whatever you written.

Waiting for your reply.

Thanks.

@0xinhua
Copy link

0xinhua commented Sep 10, 2019

@AbhishekChourasia16690
check this doc => https://facebook.github.io/react-native/docs/getting-started
select MacOS and Android as Target OS.

@AbhishekChourasia16690
Copy link
Author

Hello @kevin,
I checked the website you mentioned but I'm unable to see where I set Target.
Could you send screenshot if possible so its easier for me to find it out.

Thanks.

@0xinhua
Copy link

0xinhua commented Sep 10, 2019

check here:
set Target png

@AbhishekChourasia16690
Copy link
Author

Hello @kevin,

Thanks for the screenshot.

I'm following the steps.

How to perform the second step you mentioned.

Waiting for your reply.

Thanks.

@AbhishekChourasia16690
Copy link
Author

Hello @kevin,

Also they have mentioned in their website below line:

"If you have already installed Node on your system, make sure it is Node 8.3 or newer."

But the npm version I have is 6.9.0. When I tried updating the npm version its upgrading to only 6.11.3

Will this affect the working of React Native Android version.

Could you guide me through this too as well?

Waiting for your reply.

Thanks.

@0xinhua
Copy link

0xinhua commented Sep 10, 2019

try using nvm or n to update your Node version.

@AbhishekChourasia16690
Copy link
Author

Hello @kevin,

Thanks for the screenshot.

I'm following the steps.

How to perform the second step you mentioned.

Waiting for your reply.

Thanks.

@AbhishekChourasia16690
Copy link
Author

Hello @kevin,

Do we have a .sln file kind of file for react-native project because whenever I try to open a project in Visual Studio it doesn't take import the entire react-native folder but just single file.

Screenshot 2019-09-11 at 10 33 52 AM

![Screenshot 2019-09-11 at 10 34 02 AM](https://user-images.githubusercontent.com/22599405/64669711-3e70e800-d480-11e9-8ecd-135935d9f5ad.png) ![Screenshot 2019-09-11 at 10 34 07 AM](https://user-images.githubusercontent.com/22599405/64669712-3f097e80-d480-11e9-8106-012dbf27b3c1.png)

Please don't miss out answering the previous question too.

Thanks.

@AbhishekChourasia16690
Copy link
Author

Hello,

Could anyone please please please please help me resolve this issue.

Waiting for reply.

Thanks.

@AbhishekChourasia16690
Copy link
Author

Hey guys,

Any updates on this issue thread?

Thanks

@AbhishekChourasia16690
Copy link
Author

Hello All,

PLEASE UPDATE ON THIS THREAD

Thanks

@stale
Copy link

stale bot commented Dec 19, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 19, 2019
@stale
Copy link

stale bot commented Dec 26, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Dec 26, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Dec 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants