devfd/react-native-workers

Compile error: cannot find symbol

davidsundstrom opened this issue · 0 comments

Compiling my project on android throws me errors.
I get 11 errors in android studios formulated similarily: error: cannot find symbol <...> :
skarmavbild 2018-12-05 kl 13 35 20
and when running in terminal:

> Task :react-native-workers:compileDebugJavaWithJavac FAILED
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/BaseReactPackage.java:11: error: cannot find symbol
import com.facebook.react.modules.core.JSTimersExecution;
                                      ^
  symbol:   class JSTimersExecution
  location: package com.facebook.react.modules.core
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:9: error: JSCJavaScriptExecutor is not public in com.facebook.react.bridge; cannot be accessed from outside package
import com.facebook.react.bridge.JSCJavaScriptExecutor;
                                ^
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:19: error: cannot find symbol
import com.facebook.react.devsupport.DevSupportManager;
                                    ^
  symbol:   class DevSupportManager
  location: package com.facebook.react.devsupport
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:29: error: cannot find symbol
    private DevSupportManager devSupportManager;
            ^
  symbol:   class DevSupportManager
  location: class ReactContextBuilder
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:42: error: cannot find symbol
    public ReactContextBuilder setDevSupportManager(DevSupportManager devSupportManager) {
                                                    ^
  symbol:   class DevSupportManager
  location: class ReactContextBuilder
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:128: error: cannot find symbol
    private void addJSModules(JavaScriptModuleRegistry.Builder jsModulesBuilder) {
                                                      ^
  symbol:   class Builder
  location: class JavaScriptModuleRegistry
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:137: error: cannot find symbol
    private void addNativeModules(ReactApplicationContext reactContext, NativeModuleRegistry.Builder nativeRegistryBuilder) {
                                                                                            ^
  symbol:   class Builder
  location: class NativeModuleRegistry
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/WorkerModule.java:16: error: cannot find symbol
import com.facebook.react.devsupport.DevSupportManager;
                                    ^
  symbol:   class DevSupportManager
  location: package com.facebook.react.devsupport
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/WorkerModule.java:188: error: cannot find symbol
    private DevSupportManager getDevSupportManager() {
            ^
  symbol:   class DevSupportManager
  location: class WorkerModule
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/BaseReactPackage.java:42: error: constructor AndroidInfoModule in class AndroidInfoModule cannot be applied to given types;
                new AndroidInfoModule(),
                ^
  required: ReactApplicationContext
  found: no arguments
  reason: actual and formal argument lists differ in length
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/BaseReactPackage.java:46: error: cannot find symbol
                new SourceCodeModule(reactInstanceManager.getSourceUrl()),
                                                         ^
  symbol:   method getSourceUrl()
  location: variable reactInstanceManager of type ReactInstanceManager
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/BaseReactPackage.java:61: error: method does not override or implement a method from a supertype
    @Override
    ^
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/BaseReactPackage.java:65: error: cannot find symbol
                JSTimersExecution.class,
                ^
  symbol:   class JSTimersExecution
  location: class BaseReactPackage
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:53: error: package JSCJavaScriptExecutor does not exist
        JavaScriptExecutor jsExecutor = new JSCJavaScriptExecutor.Factory().create(new WritableNativeMap());
                                                                 ^
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:62: error: cannot find symbol
        NativeModuleRegistry.Builder nativeRegistryBuilder = new NativeModuleRegistry.Builder();
                            ^
  symbol:   class Builder
  location: class NativeModuleRegistry
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:62: error: cannot find symbol
        NativeModuleRegistry.Builder nativeRegistryBuilder = new NativeModuleRegistry.Builder();
                                                                                     ^
  symbol:   class Builder
  location: class NativeModuleRegistry
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:66: error: cannot find symbol
        JavaScriptModuleRegistry.Builder jsModulesBuilder = new JavaScriptModuleRegistry.Builder();
                                ^
  symbol:   class Builder
  location: class JavaScriptModuleRegistry
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:66: error: cannot find symbol
        JavaScriptModuleRegistry.Builder jsModulesBuilder = new JavaScriptModuleRegistry.Builder();
                                                                                        ^
  symbol:   class Builder
  location: class JavaScriptModuleRegistry
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/core/ReactContextBuilder.java:131: error: cannot find symbol
            for (Class<? extends JavaScriptModule> jsModuleClass : reactPackage.createJSModules()) {
                                                                               ^
  symbol:   method createJSModules()
  location: variable reactPackage of type ReactPackage
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/WorkerModule.java:180: error: no suitable method found for createFileLoader(ReactApplicationContext,String)
        return JSBundleLoader.createFileLoader(getReactApplicationContext(), "assets://workers/" + jsFileSlug + ".bundle");
                             ^
    method JSBundleLoader.createFileLoader(String) is not applicable
      (actual and formal argument lists differ in length)
    method JSBundleLoader.createFileLoader(String,String,boolean) is not applicable
      (actual and formal argument lists differ in length)
/Users/admin/Documents/Local/Parking-app/node_modules/react-native-workers/android/src/main/java/co/apptailor/Worker/WorkerPackage.java:21: error: method does not override or implement a method from a supertype
    @Override
    ^
21 errors


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-workers: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 8s
93 actionable tasks: 75 executed, 18 up-to-date
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/getting-started.html

"dependencies": {
"axios": "^0.18.0",
"geolib": "^2.0.24",
"lottie-react-native": "^2.5.9",
"react": "16.4.1",
"react-native": "0.56.1",
"react-native-cli": "^2.0.1",
"react-native-push-notification": "^3.1.1",
"react-native-sortable-listview": "^0.2.8",
"react-native-svg": "^0.7.2", //Former 0.7.2
"react-native-workers": "^0.3.1",
"react-navigation": "^2.16.0"
},
node version: v8.11.4

I had the same problem with react-native-svg and solved it by clearing node_modules and re installing again.
software-mansion/react-native-svg#866 (comment)
But it got me this error instead.