sAleksovski / react-native-android-widget

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

Install issue #102

Open dgellisco opened 2 days ago

dgellisco commented 2 days ago

Hi there! I saw your package looks feature-rich and maintained, so I thought I would try it out.

I am doing a fresh react-native install on Nov 4th 2024.

my package.json

{
  "name": "my-app",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "devtools": "react-devtools",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest --watch"
  },
  "dependencies": {
    "@notifee/react-native": "^9.1.2",
    "@react-native-community/checkbox": "^0.5.17",
    "@react-native-community/datetimepicker": "^8.2.0",
    "@react-native-community/slider": "^4.5.5",
    "@react-native-firebase/app": "^21.3.0",
    "@react-native-firebase/auth": "^21.3.0",
    "@react-native-firebase/database": "^21.3.0",
    "@react-navigation/bottom-tabs": "^6.6.1",
    "@react-navigation/material-top-tabs": "^6.6.14",
    "@react-navigation/native": "^6.1.18",
    "@react-navigation/native-stack": "^6.11.0",
    "formik": "^2.4.6",
    "lodash": "^4.17.21",
    "luxon": "^3.5.0",
    "react": "18.3.1",
    "react-native": "0.76.1",
    "react-native-safe-area-context": "^4.14.0",
    "react-native-screens": "^3.35.0",
    "react-native-svg": "^15.8.0",
    "react-native-vector-icons": "^10.2.0",
    "victory-native": "^37.3.1",
    "yup": "^1.4.0"
  },
  "devDependencies": {
    "@babel/core": "^7.25.2",
    "@babel/preset-env": "^7.25.3",
    "@babel/runtime": "^7.25.0",
    "@react-native-community/cli": "15.0.0",
    "@react-native-community/cli-platform-android": "15.0.0",
    "@react-native-community/cli-platform-ios": "15.0.0",
    "@react-native/babel-preset": "0.76.1",
    "@react-native/eslint-config": "0.76.1",
    "@react-native/metro-config": "0.76.1",
    "@react-native/typescript-config": "0.76.1",
    "@types/lodash": "^4.17.13",
    "@types/luxon": "^3.4.2",
    "@types/react": "^18.2.6",
    "@types/react-native-vector-icons": "^6.4.18",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-import": "^2.31.0",
    "eslint-plugin-prettier": "^5.2.1",
    "jest": "^29.6.3",
    "prettier": "^3.3.3",
    "react-test-renderer": "18.3.1",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }
}

I get the following error when immediately runing npx react-native run-android after install.

C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:27: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal
    private ReactViewBackgroundDrawable mReactViewBackground;
            ^
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:129: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types;
            getReactViewBackground().setBorderColor(
                                    ^
  required: int,Integer
  found:    int,int,int
  reason: actual and formal argument lists differ in length
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:134: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types;
            getReactViewBackground().setBorderColor(
                                    ^
  required: int,Integer
  found:    int,int,int
  reason: actual and formal argument lists differ in length
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:139: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types;
            getReactViewBackground().setBorderColor(
                                    ^
  required: int,Integer
  found:    int,int,int
  reason: actual and formal argument lists differ in length
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:144: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types;
            getReactViewBackground().setBorderColor(
                                    ^
  required: int,Integer
  found:    int,int,int
  reason: actual and formal argument lists differ in length
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:161: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal
            getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("topRight")), 1);
                                    ^
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:162: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal
            getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("bottomRight")), 2);
                                    ^
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:163: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal
            getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("bottomLeft")), 3);
                                    ^
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:164: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal
            getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("topLeft")), 0);
                                    ^
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:210: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal
    private ReactViewBackgroundDrawable getReactViewBackground() {
            ^
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:212: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal
            mReactViewBackground = new ReactViewBackgroundDrawable(view.getContext());
                                       ^
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:212: warning: [removal] ReactViewBackgroundDrawable(Context) in ReactViewBackgroundDrawable has been deprecated and marked for removal
            mReactViewBackground = new ReactViewBackgroundDrawable(view.getContext());
                                   ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
8 warnings

FAILURE: Build 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 --info option to get more log output.
> Run with --scan to get full insights.

BUILD FAILED in 1m 3s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:27: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal private ReactViewBackgroundDrawable mReactViewBackground; ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:129: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types; getReactViewBackground().setBorderColor( ^ required: int,Integer found: int,int,int reason: actual and formal argument lists differ in length C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:134: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types; getReactViewBackground().setBorderColor( ^ required: int,Integer found: int,int,int reason: actual and formal argument lists differ in length C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:139: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types; getReactViewBackground().setBorderColor( ^ required: int,Integer found: int,int,int reason: actual and formal argument lists differ in length C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:144: error: method setBorderColor in class CSSBackgroundDrawable cannot be applied to given types; getReactViewBackground().setBorderColor( ^ required: int,Integer found: int,int,int reason: actual and formal argument lists differ in length C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:161: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("topRight")), 1); ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:162: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("bottomRight")), 2); ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:163: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("bottomLeft")), 3); ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:164: warning: [removal] setRadius(float,int) in CSSBackgroundDrawable has been deprecated and marked for removal getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("topLeft")), 0); ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:210: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal private ReactViewBackgroundDrawable getReactViewBackground() { ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:212: warning: [rearked for removal getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("topLeft")), 0); ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:210: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal private ReactViewBackgroundDrawable getReactViewBackground() { ^ C:\Codinarked for removal getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("topLeft")), 0); ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:210: warning: [removal] ReactViewBackgroundDrawable inarked for removal getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("topLeft")), 0); ^ C:\Coding\my-app\node_modules\react-native-andrarked for removal getReactViewBackground().setRadius(dpToPx(borderRadius.getDouble("topLeft")), 0); ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:210: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal private ReactViewBackgroundDrawable getReactViewBackground() { ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:212: warning: [removal] ReactViewBackgroundDrawable in com.facebook.react.views.view has been deprecated and marked for removal mReactViewBackground = new ReactViewBackgroundDrawable(view.getContext()); ^ C:\Coding\my-app\node_modules\react-native-android-widget\android\src\main\java\com\reactnativeandroidwidget\builder\widget\BaseWidget.java:212: warning: [removal] ReactViewBackgroundDrawable(Context) in ReactViewBackgroundDrawable has been deprecated and marked for removal mReactViewBackground = new ReactViewBackgroundDrawable(view.getContext()); ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 4 errors 8 warnings FAILURE: Build 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 --info option to get more log output. > Run with --scan to get full insights. BUILD FAILED in 1m 3s.
info Run CLI with --verbose flag for more details.
sAleksovski commented 1 day ago

Looks like something changed in ReactViewBackgroundDrawable that we were using in RN 0.76

I'll try to release a new version soon that is compatible with RN 0.76