Skip to content

Autolink not working for React Native 0.69 #522

Open

Description

@mitsuharu

Expected Behavior

React Native 0.69 autolink works with react-native-sqlite-storage.

Current Behavior

React Native 0.69 autolink does not work, since it changes react-native cli, react-native-community/cli#1537.

Possible Solution

It removes deprecated params from react-native.config.

Steps to Reproduce (for bugs)

  1. create a new React Native Project version 0.69
  2. install react-native-sqlite-storage
  3. call openDatabase method then show below message.
    [TypeError: null is not an object (evaluating 'NativeModules["SQLite"][method]')]

Context

Your Environment

  • React Native SQLite Storage Version used: 6.0.1
  • React Native version used: 0.69
  • Operating System and version (simulator or device): iOS

Debug logs

Activity

  1. nelihabuzava2 commented on Jun 28, 2022

    @nelihabuzava2

    +1

  2. roberthobblebottom commented on Jul 1, 2022

    @roberthobblebottom

    I have the same error.

    
    TypeError: null is not an object (evaluating 'NativeModules["SQLite"][method]')
    at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:4 in reportException
    at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
    at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
    at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
    at node_modules/metro-runtime/src/polyfills/require.js:203:6 in guardedLoadModule
    at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:161585:3 in global code
    
    

    while following this guide

    Also had a Invariant Violation: "main" has not been registered. error. Not sure what this is but I want to handle the first bug first.

    My Environment

    • React Native SQLite Storage Version used: 6.0.1
    • React Native version used: 0.69.1
    • Operating System and version (simulator or device): Android
  3. yudizAnkita commented on Jul 5, 2022

    @yudizAnkita

    +1

  4. rassemdev commented on Jul 6, 2022

    @rassemdev

    same here. happening this with latest react native version.
    first this warning
    warn Package react-native-sqlite-storage has been ignored because it contains invalid configuration. Reason: "dependency.platforms.ios.project" is not allowed

    then giving this error:

    ERROR  TypeError: null is not an object (evaluating 'NativeModules["SQLite"][method]')
     ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
          This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
     ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
          This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native
    
  5. AlejandroBelloIglesias commented on Jul 7, 2022

    @AlejandroBelloIglesias

    I had to downgrade my project to 0.68.2

  6. zhuanghongji commented on Jul 10, 2022

    @zhuanghongji

    There is a new version of @react-native-community/cli (V8.0.3) released 2 days ago, after bump to this version, everything about react-native-sqlite-storage in my project works like before.

    Note: you can check the version of @react-native-community/cli in yarn.lock, if it is not V8.0.3, maybe you should delete yarn.lock file and rerun yarn install to generate the file again and bump the version of @react-native-community/cli to latest.

  7. featuriz commented on Jul 29, 2022

    @featuriz

    #527

    Solution: #523

    Yet its not merged to main.
    Maintainers please do merge this OR do something soon.

  8. mitsuharu commented on Jul 29, 2022

    @mitsuharu
    Author

    I have added a patch file (patch-package) for this issue.

  9. featuriz commented on Aug 1, 2022

    @featuriz

    Hello @mitsuharu I saw that file, But I don't know how to use in npm update or in my packages file. Can you please guide me on How to use this patch.

  10. mitsuharu commented on Aug 2, 2022

    @mitsuharu
    Author

    @featuriz

    1. set up patch-package for your project
    2. open node_modules/react-native-sqlite-storage/react-native.config.js
    3. edit as follows
    -			ios: {
    -				project: './platforms/ios/SQLite.xcodeproj'
    -			},
    +			ios: {},
    1. run npx patch-package react-native-sqlite-storage at terminal
    2. patch-package makes react-native-sqlite-storage+6.0.1.patch and add it to {$root}/patches
    3. build your project!

    https://gist.github.com/mitsuharu/2167565246e2808bb9c240cfaf6d0bf4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions