sAleksovski / react-native-android-widget

Build Android Widgets with React Native
https://sAleksovski.github.io/react-native-android-widget/
MIT License
546 stars 22 forks source link

An error after the library is added to Android #56

Closed UmarbekSaidov closed 7 months ago

UmarbekSaidov commented 7 months ago

When I add the library to my project, the following errors came out

Task :react-native-android-widget:compileDebugJavaWithJavac FAILED

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
33 actionable tasks: 2 executed, 31 up-to-date
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:14: error: package com.facebook.react.defaults does not exist
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
                                  ^
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:15: error: package com.facebook.react.defaults does not exist
import com.facebook.react.defaults.DefaultReactActivityDelegate;
                                  ^
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:45: error: cannot find symbol
        return new DefaultReactActivityDelegate(
                   ^
  symbol:   class DefaultReactActivityDelegate
  location: class RNWidgetConfigurationActivity
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:52: error: method does not override or implement a method from a supertype
            @Override
            ^
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:48: error: cannot find symbol
            DefaultNewArchitectureEntryPoint.getFabricEnabled(),
            ^
  symbol:   variable DefaultNewArchitectureEntryPoint
  location: class RNWidgetConfigurationActivity
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:50: error: cannot find symbol
            DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled()) {
            ^
  symbol:   variable DefaultNewArchitectureEntryPoint
  location: class RNWidgetConfigurationActivity
Note: /home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetCollectionService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
6 errors

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-android-widget: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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 20s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:14: error: package com.facebook.react.defaults does not exist
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
                                  ^
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:15: error: package com.facebook.react.defaults does not exist
import com.facebook.react.defaults.DefaultReactActivityDelegate;
                                  ^
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:45: error: cannot find symbol
        return new DefaultReactActivityDelegate(
                   ^
  symbol:   class DefaultReactActivityDelegate
  location: class RNWidgetConfigurationActivity
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:52: error: method does not override or implement a method from a supertype
            @Override
            ^
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:48: error: cannot find symbol
            DefaultNewArchitectureEntryPoint.getFabricEnabled(),
            ^
  symbol:   variable DefaultNewArchitectureEntryPoint
  location: class RNWidgetConfigurationActivity
/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetConfigurationActivity.java:50: error: cannot find symbol
            DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled()) {
            ^
  symbol:   variable DefaultNewArchitectureEntryPoint
  location: class RNWidgetConfigurationActivity
Note: /home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/react-native-android-widget/android/src/main/java/com/reactnativeandroidwidget/RNWidgetCollectionService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
6 errors

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-android-widget: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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 20s

    at makeError (/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/execa/index.js:174:9)
    at /home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/home/umarbek/WebstormProjects/AndroidWidgetApp/node_modules/@react-native-community/cli/build/index.js:142:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
   buildToolsVersion = "33.0.0"
   minSdkVersion = 21
   compileSdkVersion = 33
   targetSdkVersion = 33

"react": "18.1.0", "react-native": "0.70.6", "react-native-android-widget": "^0.9.0"

sAleksovski commented 7 months ago

Looks like React Native version 0.70.6 is not supported.

You can either upgrade your app to use a newer React Native version (at least 0.71.x), or try to use an older version of the library (0.7.0 might work).

UmarbekSaidov commented 7 months ago

Looks like React Native version 0.70.6 is not supported.

You can either upgrade your app to use a newer React Native version (at least 0.71.x), or try to use an older version of the library (0.7.0 might work).

Do you have any future plans to make it work for older versions of react native?

sAleksovski commented 7 months ago

Looks like React Native version 0.70.6 is not supported.

You can either upgrade your app to use a newer React Native version (at least 0.71.x), or try to use an older version of the library (0.7.0 might work).

Do you have any future plans to make it work for older versions of react native?

No