2016-10-02 283 views
1

當我運行react-native run-android時,出現以下錯誤;我正在設置它在設備上運行。React Native Android:app:compileDebugJava error

:app:compileDebugJava 
/Users/hello/MediaFire/apps/test2/android/app/src/main/java/com/test2/MainApplication.java:6: error: cannot find symbol 
import com.facebook.react.ReactApplication; 
         ^
    symbol: class ReactApplication 
    location: package com.facebook.react 
/Users/hello/MediaFire/apps/test2/android/app/src/main/java/com/test2/MainApplication.java:8: error: cannot find symbol 
import com.facebook.react.ReactNativeHost; 
         ^
    symbol: class ReactNativeHost 
    location: package com.facebook.react 
/Users/hello/MediaFire/apps/test2/android/app/src/main/java/com/test2/MainApplication.java:15: error: cannot find symbol 
public class MainApplication extends Application implements ReactApplication { 
                  ^
    symbol: class ReactApplication 
/Users/hello/MediaFire/apps/test2/android/app/src/main/java/com/test2/MainApplication.java:17: error: cannot find symbol 
    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 
       ^
    symbol: class ReactNativeHost 
    location: class MainApplication 
/Users/hello/MediaFire/apps/v/android/app/src/main/java/com/test2/MainApplication.java:32: error: cannot find symbol 
    public ReactNativeHost getReactNativeHost() { 
     ^
    symbol: class ReactNativeHost 
    location: class MainApplication 
/Users/hello/MediaFire/apps/test2/android/app/src/main/java/com/test2/MainActivity.java:6: error: MainActivity is not abstract and does not override abstract method getPackages() in ReactActivity 
public class MainActivity extends ReactActivity { 
    ^
/Users/hello/MediaFire/apps/test2/android/app/src/main/java/com/test2/MainApplication.java:17: error: cannot find symbol 
    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 
                ^
    symbol: class ReactNativeHost 
    location: class MainApplication 
/Users/hello/MediaFire/apps/test2/android/app/src/main/java/com/test2/MainApplication.java:31: error: method does not override or implement a method from a supertype 
    @Override 
^
8 errors 
:app:compileDebugJava FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':app:compileDebugJava'. 
> 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: 10.738 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 

回答

相關問題