反应本机对任务':react-native-interactable:compileDebugJavaWithJavac'失败

时间:2019-09-19 23:39:05

标签: android ios react-native react-redux

我正在尝试在Android设备上运行我的应用 我没有在ios上尝试,我已经安装了所有必需的依赖项。 我正在窗户上工作 这就是我所做的=> react-native run-android => 这就是我得到的** ps:我已经尝试过在Google中找到的所有解决方案,但对我没有任何帮助 如果您有任何解决方法,请先谢谢**

> Configure project :app
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:3: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:51: error: cannot find symbol
            @Nullable ReadableArray args) {
             ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:81: error: cannot find symbol
    public void setVerticalOnly(InteractableView view, @Nullable boolean verticalOnly) {
                                                        ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:86: error: cannot find symbol
    public void setStartOnFront(InteractableView view, @Nullable boolean startOnFront) {
                                                        ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:91: error: cannot find symbol
    public void setHorizontalOnly(InteractableView view, @Nullable boolean horizontalOnly) {
                                                          ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:96: error: cannot find symbol
    public void setDragEnabled(InteractableView view, @Nullable boolean dragEnabled) {
                                                       ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:101: error: cannot find symbol
    public void setSnapTo(InteractableView view, @Nullable ReadableArray snapPoints) {
                                                  ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:106: error: cannot find symbol
    public void setSprings(InteractableView view, @Nullable ReadableArray springs) {
                                                   ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:111: error: cannot find symbol
    public void setGravity(InteractableView view, @Nullable ReadableArray gravityPoints) {
                                                   ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:116: error: cannot find symbol
    public void setFriction(InteractableView view, @Nullable ReadableArray frictionAreas) {
                                                    ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:121: error: cannot find symbol
    public void setAlertAreas(InteractableView view, @Nullable ReadableArray alertAreas) {
                                                      ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:126: error: cannot find symbol
    public void setDrag(InteractableView view, @Nullable ReadableMap dragWithSpring) {
                                                ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:131: error: cannot find symbol
    public void setDragToss(InteractableView view, @Nullable float dragToss) {
                                                    ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:136: error: cannot find symbol
    public void setReportOnAnimatedEvents(InteractableView view, @Nullable boolean reportOnAnimatedEvents) {
                                                                  ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:141: error: cannot find symbol
    public void setBoundaries(InteractableView view, @Nullable ReadableMap boundaries) {
                                                      ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:146: error: cannot find symbol
    public void setInitialPosition(InteractableView view, @Nullable ReadableMap setInitialPosition) {
                                                           ^
  symbol:   class Nullable
  location: class InteractableViewManager
Note: C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\physics\PhysicsBehavior.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
16 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-interactable: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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 46s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-fbsdk\android\src\main\java\com\facebook\reactnative\androidsdk\Utility.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-google-signin\android\src\main\java\co\apptailor\googlesignin\RNGoogleSigninModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:3: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:51: error: cannot find symbol
            @Nullable ReadableArray args) {
             ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:81: error: cannot find symbol
    public void setVerticalOnly(InteractableView view, @Nullable boolean verticalOnly) {
                                                        ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:86: error: cannot find symbol
    public void setStartOnFront(InteractableView view, @Nullable boolean startOnFront) {
                                                        ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:91: error: cannot find symbol
    public void setHorizontalOnly(InteractableView view, @Nullable boolean horizontalOnly) {
                                                          ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:96: error: cannot find symbol
    public void setDragEnabled(InteractableView view, @Nullable boolean dragEnabled) {
                                                       ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:101: error: cannot find symbol
    public void setSnapTo(InteractableView view, @Nullable ReadableArray snapPoints) {
                                                  ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:106: error: cannot find symbol
    public void setSprings(InteractableView view, @Nullable ReadableArray springs) {
                                                   ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:111: error: cannot find symbol
    public void setGravity(InteractableView view, @Nullable ReadableArray gravityPoints) {
                                                   ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:116: error: cannot find symbol
    public void setFriction(InteractableView view, @Nullable ReadableArray frictionAreas) {
                                                    ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:121: error: cannot find symbol
    public void setAlertAreas(InteractableView view, @Nullable ReadableArray alertAreas) {
                                                      ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:126: error: cannot find symbol
    public void setDrag(InteractableView view, @Nullable ReadableMap dragWithSpring) {
                                                ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:131: error: cannot find symbol
    public void setDragToss(InteractableView view, @Nullable float dragToss) {
                                                    ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:136: error: cannot find symbol
    public void setReportOnAnimatedEvents(InteractableView view, @Nullable boolean reportOnAnimatedEvents) {
                                                                  ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:141: error: cannot find symbol
    public void setBoundaries(InteractableView view, @Nullable ReadableMap boundaries) {
                                                      ^
  symbol:   class Nullable
  location: class InteractableViewManager
C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\InteractableViewManager.java:146: error: cannot find symbol
    public void setInitialPosition(InteractableView view, @Nullable ReadableMap setInitialPosition) {
                                                           ^
  symbol:   class Nullable
  location: class InteractableViewManager
Note: C:\Users\hp\kaalix\kaalix_taxi_dev\node_modules\react-native-interactable\lib\android\src\main\java\com\wix\interactable\physics\PhysicsBehavior.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
16 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-interactable: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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 46s

4 个答案:

答案 0 :(得分:0)

这一次发生在我身上,但是在将我的应用重构为androidx之后却在另一个库上。我用jetifier来解决。您可以尝试一下,看看这是否对您有用吗?

步骤:

  1. 首先,使用Android Studio的重构工具将您的应用重新转换为Android developer docs
  2. npm install --save-dev jetifier
  3. npx jetify
  4. npx react-native run-android(您的应用程序应正确编译和运行)
  5. 调用npx jetify在package.json的安装后目标中运行(每当您的依赖项更新时,您都必须再次进行喷射)

答案 1 :(得分:0)

我认为您正在项目中使用androidX。如果正确,则必须迁移到androidX,然后按照this

答案 2 :(得分:0)

我遇到了这些相同的错误。问题是react native已迁移到60.0+版本,现在将支持androidX。因此,图书馆很难适应不断变化的变化。

您可能正在使用androidX库,或者react native在使用androidX,这导致解析库时出现问题。

做一件事:import androidx.annotation.Nullable;

将此行添加到导致此问题的库导入中。您可能需要在存储库的节点模块文件夹中添加此行。

答案 3 :(得分:0)

您需要升级源库react-native-interactable

我建议您阅读此链接 HERE 希望对您有用