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

Error building app with the @next version (2.0.0-alpha.2) #7

Open
jannone opened this issue Aug 4, 2017 · 2 comments
Open

Error building app with the @next version (2.0.0-alpha.2) #7

jannone opened this issue Aug 4, 2017 · 2 comments

Comments

@jannone
Copy link

jannone commented Aug 4, 2017

I'm trying to build an Android app using the latest version on npm (tag @next)

Here's what I did:

$ yarn add react-native-region-monitor@next
$ react-native link
$ react-native run-android

Here is the error:

Scanning 571 folders for symlinks in /[...]/RNLocationTest/node_modules (8ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > Configuration with name 'default' not found.

* 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: 2.074 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

Previous version builds, but doesn't work because the Android code was not implemented yet.

This is my react-native version:

$ react-native -v
react-native-cli: 2.0.1
react-native: 0.46.4
@jannone
Copy link
Author

jannone commented Aug 4, 2017

Not sure if it helps, but if I do this:

$ cd node_modules/react-native-region-monitor/android
$ gradlew build

It says:

[...]
:lib:compileDebugJavaWithJavac
/[...]/RNLocationTest/node_modules/react-native-region-monitor/android/lib/src/main/java/com/cube/geofencing/RNRegionTransitionService.java:7: error: cannot find symbol
import com.facebook.react.HeadlessJsTaskService;
                         ^
  symbol:   class HeadlessJsTaskService
  location: package com.facebook.react
/[...]/RNLocationTest/node_modules/react-native-region-monitor/android/lib/src/main/java/com/cube/geofencing/RNRegionTransitionService.java:11: error: package com.facebook.react.jstasks does not exist
import com.facebook.react.jstasks.HeadlessJsTaskConfig;
                                 ^
[...]

@Buthrakaur
Copy link
Contributor

It looks like you don't have react-native installed as a NPM dependency or you don't have RN correctly included in your gradle file. Maybe RN link command didn't work well..

    compile "com.facebook.react:react-native:+"  // From node_modules
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }

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

2 participants