sAleksovski / react-native-android-widget

Build Android Widgets with React Native

Home Page:https://sAleksovski.github.io/react-native-android-widget/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invariant Violation: "RNWidgetConfigurationScreen" has not been registered.

arhaanb opened this issue · comments

Hi, I've followed the tutorial in its entirety on an existing Expo project and created a development build. I'm able to see the widget in my picker but every time I add it to the homescreen the screen whites out and throws an error

Invariant Violation: "RNWidgetConfigurationScreen" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes

I've changed the main entry in the package.json file to index.js and it looks like this

import { registerRootComponent } from 'expo'
import { registerWidgetTaskHandler } from 'react-native-android-widget'

import App from './App'
import { widgetTaskHandler } from './widget-task-handler'

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App)
registerWidgetTaskHandler(widgetTaskHandler)

Every file's code (widgetTaskHandler, HelloWidget) has directly been copied from the tutorial itself but I'm not able to run the basic example somehow. Could someone please help out?

Hi,

Looks like you made your widget configurable, but didn't register a configuration screen.

Please see https://saleksovski.github.io/react-native-android-widget/docs/tutorial/make-widget-configurable#make-widget-configurable-in-expo-using-config-plugin , or if you don't need it to be configurable remove the widgetFeatures: 'reconfigurable' part from the widget configuration.