如何在使用react native构建APK中解决此问题?

时间:2019-04-19 10:25:16

标签: java react-native build google-play main-activity

我在应用商店上发布了一个应用,尝试安装该应用,但崩溃了。因此,我发现我的项目中没有捆绑软件,我添加了捆绑软件,现在尝试构建新apk时出现11个错误。这就是错误:

Task :app:compileReleaseJavaWithJavac FAILED
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:5: error: cannot find symbol
import com.facebook.react.ReactApplication;
                         ^
  symbol:   class ReactApplication
  location: package com.facebook.react
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:6: error: cannot find symbol
import com.facebook.react.ReactNativeHost;
                         ^
  symbol:   class ReactNativeHost
  location: package com.facebook.react
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:14: error: cannot find symbol
public class MainApplication extends Application implements ReactApplication {
                                                            ^
  symbol: class ReactApplication
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:16: error: cannot find symbol
  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
                ^
  symbol:   class ReactNativeHost
  location: class MainApplication
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:36: error: cannot find symbol
  public ReactNativeHost getReactNativeHost() {
         ^
  symbol:   class ReactNativeHost
  location: class MainApplication
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:16: error: cannot find symbol
  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
                                                       ^
  symbol:   class ReactNativeHost
  location: class MainApplication
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:17: error: method does not override or implement a method from a supertype
    @Override
    ^
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:22: error: method does not override or implement a method from a supertype
    @Override
    ^
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:29: error: method does not override or implement a method from a supertype
    @Override
    ^
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainApplication.java:35: error: method does not override or implement a method from a supertype
  @Override
  ^
/home/marco/Progetti/Brawl/android/app/src/main/java/com/brawl/MainActivity.java:5: error: MainActivity is not abstract and does not override abstract method getPackages() in ReactActivity
public class MainActivity extends ReactActivity {
       ^
11 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.

1 个答案:

答案 0 :(得分:0)

似乎您没有安装Android SDK或某些依赖项。按照您所说的,这似乎是第一种情况。