簡體   English   中英

FAILURE:構建失敗,React Native Android中出現異常

[英]FAILURE: Build failed with an exception in React Native Android

我正在使用react-native-cli:1.2.0,react-native:0.40.0並且正在使用Ubuntu 16.04。

我正在嘗試使用Android應用程序實現react-native-navigation ,但它給出了如下錯誤:

錯誤截圖

降級到反應原生0.25.1后我有以下問題:

/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

存在com.facebook.react.LifeCycleState的React Native的最新版本是0.34.x,因此該模塊不能用於react-native> = 0.35.0 commit#406a1b3c

其實我可以看到v2分支 ,仔細閱讀!

更新:主項目頁面上存在有關受支持的React Native版本的相同描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM