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

Package build error when running react-native #3

Open
cdesch opened this issue Mar 31, 2017 · 9 comments
Open

Package build error when running react-native #3

cdesch opened this issue Mar 31, 2017 · 9 comments

Comments

@cdesch
Copy link

cdesch commented Mar 31, 2017

Error after linking then running react-native run-android



FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.hoho.android:usb-serial-for-android:0.2.0-SNAPSHOT.
     Searched in the following locations:
         https://jcenter.bintray.com/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/maven-metadata.xml
         https://jcenter.bintray.com/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/usb-serial-for-android-0.2.0-SNAPSHOT.pom
         https://jcenter.bintray.com/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/usb-serial-for-android-0.2.0-SNAPSHOT.aar
         file:/Users/cj/Library/Android/sdk/extras/android/m2repository/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/maven-metadata.xml
         file:/Users/cj/Library/Android/sdk/extras/android/m2repository/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/usb-serial-for-android-0.2.0-SNAPSHOT.pom
         file:/Users/cj/Library/Android/sdk/extras/android/m2repository/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/usb-serial-for-android-0.2.0-SNAPSHOT.aar
         file:/Users/cj/Library/Android/sdk/extras/google/m2repository/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/maven-metadata.xml
         file:/Users/cj/Library/Android/sdk/extras/google/m2repository/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/usb-serial-for-android-0.2.0-SNAPSHOT.pom
         file:/Users/cj/Library/Android/sdk/extras/google/m2repository/com/hoho/android/usb-serial-for-android/0.2.0-SNAPSHOT/usb-serial-for-android-0.2.0-SNAPSHOT.aar
     Required by:
         MyRewards:app:unspecified > MyRewards:react-native-usbserial:unspecified

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

BUILD FAILED

Total time: 12.735 secs
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/android-setup.html

(node:2904) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'message' of undefined
(node:2904) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@mapaiva
Copy link
Owner

mapaiva commented Apr 2, 2017

It seems a problem related with a dependency that react-native-usbserial needs.

@cdesch could your share your OS specs?

@cdesch
Copy link
Author

cdesch commented Apr 5, 2017

@mapaiva Here are my specs

MacOS 10.12.3
"react-native": "^0.40.0"
"react-native-usbserial": "^1.0.0",

@mhiley
Copy link

mhiley commented May 4, 2017

I encountered this error and was able to solve it by duplicating the maven config from react-native-usbserial in my project's own configuration. Specifically, I added these lines to my android/app/build.gradle:

repositories {
  maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

@mapaiva
Copy link
Owner

mapaiva commented May 4, 2017

Great @mhiley!!! If you could create a PR with the solution it would be very appreciated 🎉

@mhiley
Copy link

mhiley commented May 4, 2017

The change was in my project that uses your library as a dependency, not in your library itself, so I don't believe there is anything to pull request.

On a side note, is it possible to read from a serial device with this library yet? I see that readAsync is unimplemented:

https://github.com/mapaiva/react-native-usbserial/blob/master/android/src/main/java/com/bmateam/reactnativeusbserial/UsbSerialDevice.java#L33

I'm interested in possibly taking a stab at implementing this, so am curious if you just haven't gotten to it yet, or was there some technical roadblock to implementing it? Any progress I make will be contributed back to your project of course 😃

@mapaiva
Copy link
Owner

mapaiva commented May 5, 2017

The change was in my project that uses your library as a dependency, not in your library itself, so I don't believe there is anything to pull request.

Hmm got it :).

On a side note, is it possible to read from a serial device with this library yet? I see that readAsync is unimplemented: (...) I'm interested in possibly taking a stab at implementing this, so am curious if you just haven't gotten to it yet, or was there some technical roadblock to implementing it?

Nope, no tech issue just a big lack of time for improving it 😄. Any contribution will be very welcome @mhiley! It'd be awesome.

In fact, I'll try to fix some minors of this project this weekend as well :D .

@HelgiHe
Copy link

HelgiHe commented Aug 2, 2017

@mhiley
Just wondering if you ever figured it out?

@mhiley
Copy link

mhiley commented Aug 2, 2017

@HelgiHe I did get a basic read implementation working, but I've still got some work to do to generalize things enough to submit it back as a pull request (specifically, "FTDI" is hard-coded as the driver) and haven't been able to find the time. Also I'm not sure I have the right hardware to properly test a generalized implementation.

Feel free to check out this branch and use it as a starting point for implementing read:

https://github.com/EarthlingInteractive/react-native-usbserial/commits/read-implementation

@HelgiHe
Copy link

HelgiHe commented Aug 3, 2017

@mhiley Great thanks for sharing. I'm actually trying to use FTDI RFID reader but we got some different hardware coming in the next few months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants