uport-project / uport-mobile

uPort mobile app
https://uport.me
GNU General Public License v3.0
76 stars 28 forks source link

Failed to Run Android Instance #77

Closed RyanJoseph15 closed 5 years ago

RyanJoseph15 commented 5 years ago

I'm trying to get up and running with an Android instance, following the README. I was able to get an iOS instance running without issues. However, react-native run-android was giving errors.

Steps to reproduce the behavior:

  1. Clone the project
  2. From that directory, in a terminal window, run native-react run-android

Expected behavior I would expect an instance of the application to be installed on the adb connected device.

Actual behavior

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':react-native-signer-wrapper:debugCompileClasspath'.
> Could not find com.facebook.react:react-native:0.55.3.
  Required by:
      project :react-native-signer-wrapper

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
38 actionable tasks: 1 executed, 37 up-to-date
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

Screenshots I made sure that I had a device running: image

System:

Smartphone:

Additional context Troubleshooting I've done:

mirceanis commented 5 years ago

There's an extra step needed between cloning the repo and running react-native run-android. The node_modules need to be resolved by running yarn. iOS and Android setups depend on JavaScript environment setup. This is a bug in the instructions in the readme so thanks for spotting it.

mirceanis commented 5 years ago

@RyanJoseph15 I made a PR to fix some of the instructions in the readme (https://github.com/uport-project/uport-mobile/pull/78/files).

TL;DR;

RyanJoseph15 commented 5 years ago

I'm going through the update README now. Thanks for jumping on this so quickly šŸ˜„

Some additional notes on getting the google-services.json file from Firebase:

  1. Sign into Firebase with your Google Account.
  2. Add Project. image
  3. Click the Android Icon. We're going to register an Android App. image
  4. Add your project and agree to the terms. image
  5. Register your app. image
  6. Download the google-services.json file and add to your local codebase.
    • Note: google-services.json is in the .gitignore file. So, nobody will accidentally check in their Firebase files šŸŽ‰ image
  7. Add Firebase SDK - don't worry about this step. These are already implemented in the appropriate gradles. image
  8. Run your app to verify installation: react-native run-android, as outlined in the updated README. image

@mirceanis At this point, running the application connects to a running device. However, when using an emulator, it gets stuck on the splash screen. I'm looking into that after attaching logcat to the device for errors. I'll update as I find thing.

RyanJoseph15 commented 5 years ago

Checking out master seems to be working, following those instructions. I was working off of my feature branch, which was created from the develop branch. This appears to be resolved now!

RyanJoseph15 commented 5 years ago

I was using an x86_64 image before. Switching to an x86 image resolved being stuck on the splash screen issue.

RyanJoseph15 commented 5 years ago

Woo-hoo!

image

kanna998 commented 4 years ago

Hi Developers, I'm able to run app using native-react run-android. But after app starts my server which start using "yarn start" is throwing an error as below, (0/1)C:\Users\\AndroidStudioProjects\uPort\uport-mobile\node_modules\graceful-fs\polyfills.js:285 if (cb) cb.apply(this, arguments) ^

TypeError: cb.apply is not a function at C:\Users\\AndroidStudioProjects\uPort\uport-mobile\node_modules\graceful-fs\polyfills.js:285:20
at FSReqCallback.oncomplete (fs.js:177:5) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Kindly help me to resolve this issue. Thanks in advance