react-native ios Podfile issue with “use_native_modules!”

前端 未结 18 1910
一生所求
一生所求 2020-12-05 17:15

In my react-native project (react-native@0.60) in the ios/ dir I run pod install and get this error:

[!] Invalid `Podfile` file: no implicit con         


        
相关标签:
18条回答
  • 2020-12-05 17:57

    maybe its related to rights issues

    adding "@react-native-community/cli-platform-ios": "3.0.0" in package.json

    and

    sudo chown -R user .

    worked for me

    0 讨论(0)
  • 2020-12-05 17:57

    Getting rid of the line use_native_modules! works as well. Maybe this has been deprecated or syntax has changed? Curious to hear from others.

    Update: Seems to be an issue with react-native 0.60.0. Until a release fixes this bug, 0.59.10 can be explicitly installed, and you only need to add CocoaPods as necessary.

    react-native init APP_NAME --version react-native@0.59.10

    0 讨论(0)
  • 2020-12-05 17:58

    Does anyone have a consistently recreatable solution for this issue that does not revolve around getting rid of use_native_modules? I have looked into:

    • Changing Ruby Version
    • Changing CocoaPods version
    • Invalidating NPM and Cocoapods cache

    And I am unable to fix the issue. It appears to be some npm dependency, but others on my team are not seeing it.

    0 讨论(0)
  • 2020-12-05 17:59

    i just dropped the whole node_modules and RN cache folder and did a clean reinstall, this fixed the "use_native_modules" problem so far....but after that i had to hassle a lot with other libs which where just not RN0.60 ready ;)

    0 讨论(0)
  • 2020-12-05 17:59

    This started happening out of the blue today, and the problem was a space in my directory structure. Ex:

    /path/to/Directory\ Name/RNProject throws the !native_modules error /path/to/DirectoryName/RNProject works as it should

    Pods was looking for "Directory. "

    0 讨论(0)
  • 2020-12-05 18:00

    After removing several react-native npm packages (ie: react-native-bluetooth-serial, react-native-sound, and more...) pod install works.

    It appears the pod install error is related to older react-native packages that don't support cocoa pods? I'm not sure the details but removing those packages from node_modules & package.json solved my issue.

    0 讨论(0)
提交回复
热议问题