My FeedDiscussionsHashnode Enterprise
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

React Native: Stuck on loading from localhost:8081

Harini R's photo
Harini R
·May 8, 2018

I am working on a react-native project and I run it on my android phone via USB debugging and the command "react-native run android".

It was working all fine but now even though the build is successful, the app gets stuck on the white screen "loading from localhost:8081". No changes were made in any of the app files.

I tried running the react-native demo app (using react-native init) and I still face the same issue.

Solutions I tried but still same issue:

1.Running this command rm -rf node_modules && npm install 2.Running this command adb reverse tcp:8081 tcp:8081 3.Running it on Android Emulator from Android Studio. 4.Running the command npm run android

This is what shows up in the command line:

react-native run-android
Scanning folders for symlinks in /home/lenovo/IRMSold/node_modules (6ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

> Configure project :app 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-google-signin 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.3) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.1.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-vector-icons 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.1.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:installDebug 
Installing APK 'app-debug.apk' on 'Lenovo X3a40 - 6.0.1' for app:debug
Installed on 1 device.


BUILD SUCCESSFUL in 13s
66 actionable tasks: 1 executed, 65 up-to-date
Running adb -s 567bf688 reverse tcp:8081 tcp:8081
Starting the app on 567bf688 (adb -s 567bf688 shell am start -n com.irms/com.irms.MainActivity)...
Starting: Intent { cmp=com.irms/.MainActivity }

Kindly help me out, as I tried every other fix I could find online. WhatsApp Image 2018-05-08 at 10.42.52.jpeg