# Error Running mobile-preview "Invariant Violation: Native module cannot be null."

**URL:** <https://forum.adalo.com/t/error-running-mobile-preview-invariant-violation-native-module-cannot-be-null/31081>\
**Category:** Get Help\
**Created:** [August 22, 2022, 11:57pm UTC](https://forum.adalo.com/t/error-running-mobile-preview-invariant-violation-native-module-cannot-be-null/31081 "2022-08-22T23:57:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![muellhe1](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@muellhe1](https://forum.adalo.com/u/muellhe1)\
**Post date:** [August 22, 2022, 11:57pm UTC](https://forum.adalo.com/t/error-running-mobile-preview-invariant-violation-native-module-cannot-be-null/31081/1 "2022-08-22T23:57:58Z")

</div>

Hello, trying to setup the mobile-preview app for component dev. Just trying to run the app in Xcode at this point, not loading any custom libs. I followed the instructions for iOS at: [Testing | Adalo](https://developers.adalo.com/docs/workflow/testing/)

Getting the following errors:

- on MacOs console:

```auto
[Mon Aug 22 2022 19:46:37.309] BUNDLE ./index.js 

[Mon Aug 22 2022 19:46:42.453] WARN Require cycle: node_modules/@protonapp/proton-runner/lib/ducks/data.js -> node_modules/@protonapp/proton-runner/lib/utils/urls.js -> node_modules/@protonapp/proton-runner/lib/utils/externalCollections.js -> node_modules/@protonapp/proton-runner/lib/utils/dependencies.js -> node_modules/@protonapp/proton-runner/lib/ducks/data.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
[Mon Aug 22 2022 19:46:42.454] WARN Require cycle: node_modules/@protonapp/proton-runner/lib/utils/urls.js -> node_modules/@protonapp/proton-runner/lib/utils/externalCollections.js -> node_modules/@protonapp/proton-runner/lib/utils/dependencies.js -> node_modules/@protonapp/proton-runner/lib/ducks/auth.js -> node_modules/@protonapp/proton-runner/lib/utils/urls.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
[Mon Aug 22 2022 19:46:42.454] WARN Require cycle: node_modules/@protonapp/proton-runner/lib/ducks/index.js -> node_modules/@protonapp/proton-runner/lib/ducks/data.js -> node_modules/@protonapp/proton-runner/lib/utils/urls.js -> node_modules/@protonapp/proton-runner/lib/utils/externalCollections.js -> node_modules/@protonapp/proton-runner/lib/utils/dependencies.js -> node_modules/@protonapp/proton-runner/lib/ducks/index.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
[Mon Aug 22 2022 19:46:42.454] ERROR Invariant Violation: Native module cannot be null.
[Mon Aug 22 2022 19:46:42.455] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Mon Aug 22 2022 19:46:43.439] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

```

- on XCode console:

```auto
...
2022-08-22 19:54:17.725681-0400 Adalo App[3279:29046] [javascript] Require cycle: node_modules/@protonapp/proton-runner/lib/ducks/index.js -> node_modules/@protonapp/proton-runner/lib/ducks/data.js -> node_modules/@protonapp/proton-runner/lib/utils/urls.js -> node_modules/@protonapp/proton-runner/lib/utils/externalCollections.js -> node_modules/@protonapp/proton-runner/lib/utils/dependencies.js -> node_modules/@protonapp/proton-runner/lib/ducks/index.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
2022-08-22 19:54:17.729367-0400 Adalo App[3279:29046] [javascript] Invariant Violation: Native module cannot be null.
2022-08-22 19:54:17.754632-0400 Adalo App[3279:29046] [javascript] Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
2022-08-22 19:54:17.801232-0400 Adalo App[3279:28866] [native] Running surface LogBox ({
    initialProps = {
    };
    rootTag = 11;
})
2022-08-22 19:54:17.802090-0400 Adalo App[3279:29046] [javascript] Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
2022-08-22 19:54:18.802768-0400 Adalo App[3279:28866] [native] Failed to mount LogBox within 1s

```

I have tried the un-merged fix at [add native modules to package.json by TDH55 · Pull Request #56 · AdaloHQ/mobile-previewer · GitHub](https://github.com/AdaloHQ/mobile-previewer/pull/56), but that made no difference. Other steps just involve redoing the install steps, rebooting system… nothing had any noticeable effect.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [September 1, 2022, 11:58pm UTC](https://forum.adalo.com/t/error-running-mobile-preview-invariant-violation-native-module-cannot-be-null/31081/2 "2022-09-01T23:58:36Z")

</div>

Closed on September 1, 2022, 11:58pm UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
