0

While following the Detox [installation tutorial for android][1], I had the following error running the detox build -c android.emu.debug


❯ detox build -c android.emu.debug detox[23052] INFO: [build.js] cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..

Task :app:generatePackageList Task :app:preBuild Task :react-native-gesture-handler:preBuild UP-TO-DATE Task :react-native-gesture-handler:preDebugBuild UP-TO-DATE Task :react-native-gesture-handler:checkDebugManifest UP-TO-DATE Task :react-native-gesture-handler:processDebugManifest UP-TO-DATE Task :react-native-reanimated:preBuild UP-TO-DATE Task :react-native-reanimated:preDebugBuild UP-TO-DATE Task :react-native-reanimated:checkDebugManifest UP-TO-DATE Task :react-native-reanimated:processDebugManifest UP-TO-DATE Task :react-native-screens:preBuild UP-TO-DATE Task :react-native-screens:preDebugBuild UP-TO-DATE Task :react-native-screens:checkDebugManifest UP-TO-DATE Task :react-native-screens:processDebugManifest UP-TO-DATE Task :react-native-vector-icons:preBuild UP-TO-DATE Task :react-native-vector-icons:preDebugBuild UP-TO-DATE Task :react-native-vector-icons:checkDebugManifest UP-TO-DATE Task :react-native-vector-icons:processDebugManifest UP-TO-DATE Task :react-native-webview:preBuild UP-TO-DATE Task :react-native-webview:preDebugBuild UP-TO-DATE Task :react-native-webview:checkDebugManifest UP-TO-DATE Task :react-native-webview:processDebugManifest UP-TO-DATE Task :app:preDebugBuild UP-TO-DATE Task :react-native-screens:compileDebugAidl NO-SOURCE Task :react-native-vector-icons:compileDebugAidl NO-SOURCE Task :react-native-gesture-handler:compileDebugAidl NO-SOURCE Task :react-native-reanimated:compileDebugAidl NO-SOURCE Task :react-native-webview:compileDebugAidl NO-SOURCE Task :app:compileDebugAidl NO-SOURCE Task :react-native-gesture-handler:packageDebugRenderscript NO-SOURCE Task :react-native-reanimated:packageDebugRenderscript NO-SOURCE Task :react-native-screens:packageDebugRenderscript NO-SOURCE Task :react-native-vector-icons:packageDebugRenderscript NO-SOURCE Task :react-native-webview:packageDebugRenderscript NO-SOURCE Task :app:compileDebugRenderscript NO-SOURCE Task :app:checkDebugManifest UP-TO-DATE Task :app:generateDebugBuildConfig UP-TO-DATE Task :app:bundleDebugJsAndAssets SKIPPED Task :app:prepareLintJar UP-TO-DATE Task :app:generateDebugSources UP-TO-DATE Task :react-native-gesture-handler:generateDebugBuildConfig UP-TO-DATE Task :react-native-gesture-handler:compileDebugRenderscript NO-SOURCE Task :react-native-gesture-handler:generateDebugResValues UP-TO-DATE Task :react-native-gesture-handler:generateDebugResources UP-TO-DATE Task :react-native-gesture-handler:prepareLintJar UP-TO-DATE Task :react-native-gesture-handler:generateDebugSources UP-TO-DATE Task :react-native-gesture-handler:javaPreCompileDebug UP-TO-DATE Task :react-native-gesture-handler:packageDebugResources UP-TO-DATE Task :react-native-gesture-handler:generateDebugRFile UP-TO-DATE

> Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java:4: error: package com.facebook.react.module.annotations does not exist import com.facebook.react.module.annotations.ReactModule; ^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java:17: error: cannot find symbol @ReactModule(name = RNGestureHandlerRootViewManager.REACT_CLASS) ^ symbol: class ReactModule /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:16: error: package com.facebook.react.module.annotations does not exist import com.facebook.react.module.annotations.ReactModule; ^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:19: error: cannot find symbol import com.facebook.react.uimanager.UIBlock; ^ symbol: class UIBlock location: package com.facebook.react.uimanager /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:40: error: cannot find symbol @ReactModule(name=RNGestureHandlerModule.MODULE_NAME) ^ symbol: class ReactModule /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java:218: error: cannot find symbol @ReactProp(name = ViewProps.BORDER_RADIUS) ^ symbol: variable BORDER_RADIUS location: class ViewProps /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:41: error: method init in class Event cannot be applied to given types; super.init(handler.getView().getId()); ^ required: int,long found: int reason: actual and formal argument lists differ in length where T is a type-variable: T extends Event declared in class Event /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java:45: error: cannot find symbol return parent.getChildAt(((ReactViewGroup) parent).getZIndexMappedChildIndex(index)); ^ symbol: method getZIndexMappedChildIndex(int) location: class ReactViewGroup /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java:54: error: cannot find symbol String overflow = ((ReactViewGroup) view).getOverflow(); ^ symbol: method getOverflow() location: class ReactViewGroup /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:574: error: cannot find symbol final int rootViewTag = uiManager.resolveRootTagFromReactTag(ancestorViewTag); ^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type UIManagerModule /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:582: error: cannot find symbol if (root.getRootView().getRootViewTag() == rootViewTag) { ^ symbol: method getRootViewTag() location: class ReactRootView /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:598: error: cannot find symbol uiManager.addUIBlock(new UIBlock() { ^ symbol: class UIBlock location: class RNGestureHandlerModule /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:634: error: cannot find symbol int rootViewTag = uiManager.resolveRootTagFromReactTag(viewTag); ^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type UIManagerModule /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:641: error: cannot find symbol if (root.getRootView().getRootViewTag() == rootViewTag) { ^ symbol: method getRootViewTag() location: class ReactRootView /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerPackage.java:18: error: RNGestureHandlerPackage is not abstract and does not override abstract method createJSModules() in ReactPackage public class RNGestureHandlerPackage implements ReactPackage { ^ /home/rogerd/dev/app_cachacagestor/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:45: error: method init in class Event cannot be applied to given types; super.init(handler.getView().getId()); ^ required: int,long found: int reason: actual and formal argument lists differ in length where T is a type-variable: T extends Event declared in class Event Note: /home/rogerd/dev/app_cachacagestor/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. 16 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-gesture-handler: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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s 22 actionable tasks: 2 executed, 20 up-to-date detox[23052] ERROR: [cli.js] Error: Command failed: cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..


"react": "16.8.6",

"react-native": "0.60.5",

"detox": "^14.3.2",

"mocha": "^6.2.0",


Does anyone know how to solve ?

2
  • Welcome to stack overflow. 1- Deprecated code should generally be avoided. 2- It says "package com.facebook.react.module.annotations does not exist" so you may be missing adding something into your project. Commented Sep 19, 2019 at 14:19
  • hey did you solve this? Commented Mar 3, 2020 at 13:20

1 Answer 1

0

I solved it by changing the order of the maven repositories in android/build.gradle. My allprojects looks like this:

allprojects {
repositories {
    mavenLocal()
    google()
    jcenter()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url("$rootDir/../node_modules/react-native/android")
    }
    maven {
        // Android JSC is installed from npm
        url("$rootDir/../node_modules/jsc-android/dist")
    }
    maven {
        // All of Detox' artifacts are provided via the npm module
        url "$rootDir/../node_modules/detox/Detox-android"
    }
    maven { url 'https://www.jitpack.io' }
}

}

Thanks to gypsicoder

https://github.com/software-mansion/react-native-gesture-handler/issues/1002

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.