1

I'm using react-native-cli: 1.2.0 , react-native: 0.40.0 and working on Ubuntu 16.04.

I am trying to implement react-native-navigation with Android app, but it gives me an error like the following:

Error screenshot

After downgrading to react-native 0.25.1 I have the following issues:

/home/dinesh/Desktop/Dineshaws/android/app/src/main/java/com/dineshaws/MainApplication.java:6: error: cannot find symbol
import com.facebook.react.ReactApplication;
                         ^
  symbol:   class ReactApplication
  location: package com.facebook.react
/home/dinesh/Desktop/Dineshaws/android/app/src/main/java/com/dineshaws/MainApplication.java:8: error: cannot find symbol
import com.facebook.react.ReactNativeHost;
                         ^
  symbol:   class ReactNativeHost
  location: package com.facebook.react
/home/dinesh/Desktop/Dineshaws/android/app/src/main/java/com/dineshaws/MainApplication.java:16: error: cannot find symbol
public class MainApplication extends Application implements ReactApplication {
                                                            ^
  symbol: class ReactApplication
/home/dinesh/Desktop/Dineshaws/android/app/src/main/java/com/dineshaws/MainApplication.java:18: error: cannot find symbol
  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
                ^
  symbol:   class ReactNativeHost
  location: class MainApplication
/home/dinesh/Desktop/Dineshaws/android/app/src/main/java/com/dineshaws/MainApplication.java:33: error: cannot find symbol
  public ReactNativeHost getReactNativeHost() {
         ^
  symbol:   class ReactNativeHost
  location: class MainApplication
/home/dinesh/Desktop/Dineshaws/android/app/src/main/java/com/dineshaws/MainApplication.java:18: error: cannot find symbol
  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
                                                       ^
  symbol:   class ReactNativeHost
  location: class MainApplication
/home/dinesh/Desktop/Dineshaws/android/app/src/main/java/com/dineshaws/MainApplication.java:32: error: method does not override or implement a method from a supertype
  @Override
  ^
7 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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: 35.645 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
karel
  • 5,489
  • 46
  • 45
  • 50
Dineshaws
  • 2,065
  • 16
  • 26
  • Pro tip, since you're a high rep user: readers know you want help, because you're asking a question on a help site. Thus, "please help me" and similar material may be read as begging, and is likely to be trimmed by editors over the long term. Keep it succinct if you can! – halfer Jan 04 '17 at 22:52
  • 1
    Thanks @halfer You are awesome – Dineshaws Jan 05 '17 at 05:36

1 Answers1

0

Last version of React Native where com.facebook.react.LifeCycleState exists is 0.34.x, so this module can not be used on react-native>=0.35.0 commit #406a1b3c

Actually I can see v2 branch, read carefully!

Update: same description about supported versions of React Native exists on main project page

  • @vovkam I have updated my question, I am still getting issues even after downgrading react-native version – Dineshaws Jan 05 '17 at 17:13
  • @Dineshaws Seems like you only downgrade react-native package, you also need downgrade your app code (most simple way to do that is regenerate native code) –  Jan 05 '17 at 17:21
  • Thanks @vovkam I have upgraded my app code using react-native upgrade command – Dineshaws Jan 05 '17 at 17:25