sAleksovski / react-native-android-widget

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

Widget is not rendering #50

Closed Rohit3523 closed 10 months ago

Rohit3523 commented 10 months ago

I followed each step provided in the Tutorial page and the widget is reflecting in widget section but when i add that widget in homescreen, it just show transparent view without any text or anything.

React Native: 0.72.3 react-native-android-widget: 0.8.2

Rohit3523 commented 10 months ago

For custom widget: Here is the logcat when i place a widget

 AndroidRuntime: java.lang.RuntimeException: Unable to instantiate receiver com.minocular.dcw.widget.CBAWidget: java.lang.ClassNotFoundException: Didn't find class "com.minocular.dcw.widget.CBAWidget"

Receiver

<receiver
          android:name=".widget.CBAWidget"
          android:exported="false"
          android:label="CBA Widget">
          <intent-filter>
              <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
              <action android:name="com.minoculardcw.WIDGET_CLICK" />
          </intent-filter>
          <meta-data
              android:name="android.appwidget.provider"
              android:resource="@xml/widgetprovider_cbatrend" />
      </receiver>
Rohit3523 commented 10 months ago

For Hello example, i am getting


BroadcastQueue: Unable to launch app com.minocular.dcw/10867 for broadcast Intent { act=android.appwidget.action.APPWIDGET_ENABLED flg=0x10 cmp=com.minocular.dcw/.widget.Hello }: process is bad```
sAleksovski commented 10 months ago

I think the error is self-explanatory.

AndroidRuntime: java.lang.RuntimeException: Unable to instantiate receiver com.minocular.dcw.widget.CBAWidget: java.lang.ClassNotFoundException: Didn't find class "com.minocular.dcw.widget.CBAWidget"

You don't have a CBAWidget class, or it is on the wrong place, or with the wrong name.

Can you go through the tutorial again to see what you missed?

As for the last error, process is bad, I guess it's due to a lot of crashes due to the missing class. You should be able to Google it and find a solution.

Rohit3523 commented 10 months ago

It was my fault, i mentioned package com.minoculardcw.widget; instead of package com.minocular.dcw.widget;

Thanks for your time :)