React-native-permissions: upgraded to 0.27 but 'React/RCTConvert.h' file not found, breaking build

Created on 9 Mar 2017  路  19Comments  路  Source: zoontek/react-native-permissions

screen shot 2017-03-09 at 10 38 45 am

I have to admit that I'm not quite sure if I did something wrong or what, but I have version 0.27 in my project, I've done the rnpm link and I didn't seemingly have any issues with dependencies after running npm install.

Would you happen to know what I done did (or forgot to do)?

If there's anything more you need please let me know.

Most helpful comment

Hi,

I am facing same issue /../node_modules/react-native-svg/ios/Utils/RCTConvert+RNSVG.h:13:9: 'React/RCTConvert.h' file not found

I tried all the steps mentioned in various forum but didn't get solution. I am using RN 0.39.2 + Xcode 9.0 + Mac OS 10.12.6

All 19 comments

Same issue here

@alanhoff - what version of RN are you on? I literally had the project working yesterday with RN version 0.37 and this permissions package version 0.25 and I was loving life.

I think I made some mistake last night modifying node_modules via package.json while forgetting to close the terminal bridge and now everything is completely broken.

I've tried upgrading to RN 0.40 and I only get _more_ errors that have no solutions outside of a gathering of frustrated devs here: https://github.com/facebook/react-native/issues/12042

@smokinjoe locking the version to 0.2.5 worked..

npm install --save [email protected]

@alanhoff what version of React-Native are you running?

And are you doing any rnpm unlink react-native-permissions trickery before installing a different version?

I'm still getting nowhere fast.

I fixed it taking the following actions:
http://stackoverflow.com/questions/41477241/react-native-xcode-upgrade-and-now-rctconvert-h-not-found

Besides changing the build settings in Xcode, I also made a few changes to react-native-permissions:

./RCTConvert+RNPStatus.m

//
//  RCTConvert+RNPermissionsStatus.m
//  ReactNativePermissions
//
//  Created by Yonah Forst on 23/03/16.
//  Copyright 漏 2016 Yonah Forst. All rights reserved.
//

#import "RCTConvert.h"
#import "RCTConvert+RNPStatus.h"


@implementation RCTConvert (RNPStatus)


RCT_ENUM_CONVERTER(RNPType, (@{ @"location" : @(RNPTypeLocation),
                                @"camera" : @(RNPTypeCamera),
                                @"microphone" : @(RNPTypeMicrophone),
                                @"photo" : @(RNPTypePhoto),
                                @"contacts" : @(RNPTypeContacts),
                                @"event" : @(RNPTypeEvent),
                                @"reminder" : @(RNPTypeReminder),
                                @"bluetooth" : @(RNPTypeBluetooth),
                                @"notification" : @(RNPTypeNotification),
                                @"backgroundRefresh": @(RNPTypeBackgroundRefresh)
                                }),
                                RNPTypeUnknown, integerValue)

@end

./RCTConvert+RNPStatus.h

//
//  RCTConvert+RNPStatus
//  ReactNativePermissions
//
//  Created by Yonah Forst on 23/03/16.
//  Copyright 漏 2016 Yonah Forst. All rights reserved.
//

#import "RCTConvert.h"

static NSString* RNPStatusUndetermined = @"undetermined";
static NSString* RNPStatusDenied = @"denied";
static NSString* RNPStatusAuthorized = @"authorized";
static NSString* RNPStatusRestricted = @"restricted";


typedef NS_ENUM(NSInteger, RNPType) {
    RNPTypeUnknown,
    RNPTypeLocation,
    RNPTypeCamera,
    RNPTypeMicrophone,
    RNPTypePhoto,
    RNPTypeContacts,
    RNPTypeEvent,
    RNPTypeReminder,
    RNPTypeBluetooth,
    RNPTypeNotification,
    RNPTypeBackgroundRefresh
};

@interface RCTConvert (RNPStatus)

@end

Edit:
The second run it also gave an error on a few others:

In ./ReactNativePermissions.m changed

#import <React/RCTBridge.h>
#import <React/RCTConvert.h>
#import <React/RCTEventDispatcher.h>

to

#import "RCTBridge.h"
#import "RCTConvert.h"
#import "RCTEventDispatcher.h"

See the SO answer for more information about why to remove the

@matthijsdewit - wow, thanks! I haven't had a chance to give it a shot yet, but first thing Tuesday imma doing it.

I fixed it here in this fork
https://github.com/alextkd/react-native-permissions
until will get approved into this repo you can use it with git
"react-native-permissions":"git+ssh://[email protected]:alextkd/react-native-permissions.git"

Actually I still had a related issue even after trying @alextkd fork (using RN 4.0). I submitted a PR that fixes it (see above)

@traylewin we need to support backwards compatibility as well. i would say they will need to merge my PR in first then you should pull and add your other fixes

Hi @alextkd, Hi @traylewin

Locking your version to 0.2.5 should work. Is it not working? or do you want to use the latest version of the library with RN<0.40

Honestly? RN is changing so quickly I think it will be too hard to maintain backwards compatibility in new versions. Users should check the version support table and use the version of this library corresponding with their RN version

closing for inactivity

Hi,

I am facing same issue /../node_modules/react-native-svg/ios/Utils/RCTConvert+RNSVG.h:13:9: 'React/RCTConvert.h' file not found

I tried all the steps mentioned in various forum but didn't get solution. I am using RN 0.39.2 + Xcode 9.0 + Mac OS 10.12.6

@kkarmalkar have you find any solution? I am also facing same issue. My pod version is 1.4.0

Can reopen this issue? I got same error

Same issue here using RN 0.55.4

same issue using RN 0.58.0

Ran into this same issue.

On react-native 0.60, I am having an issue where only defining the podspecs I need is causing pod install to fail.

[!] Unable to find a specification for 'RNPermissions` depended upon by 'Permission-Microphone'

You have either: 
* out-of-date source repos...
etc

I ran the suggested pod install --repo-update, no luck.

pod deintegrate and pod install no dice.

The npx command to nuke everything, nope.

One odd thing I noticed is when I use the manual linking trick suggested in the README (Defining the spec for RNPermissions), it works but it shows a message that it is installing React 0.11.0...

Using React 0.11.0 could cause this issue as these imports changed from RCTBridgeModule.h to the current <React/RCTBridgeModule.h> some time. Not oddly enough with this knowledge, if you change these imports from the current brackets to the strings, the errors go away giving credence to it using an ancient version of React.

Still looking for the real fix as changing these imports causes further down issues.

@madelinecameron Please submit your Podfile

I am also. facing the same issue, this is my pod file. @zoontek please can you help

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

target 'Tiluf' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!


# Convert all permission pods into static libraries 
pre_install do |installer|
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}

  installer.pod_targets.each do |pod|
    if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
      def pod.build_type;
        # Uncomment the line corresponding to your CocoaPods version 
        Pod::BuildType.static_library # >= 1.9 
        # Pod::Target::BuildType.static_library # < 1.9 
      end
    end
  end
end


 post_install do |installer|
   installer.pods_project.targets.each do |target|
     if target.name == 'React'
       target.remove_from_project
     end
   end
 end


  # Pods for Tiluf

  target 'Tiluf-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'React', :path => '../node_modules/react-native'
    pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
    pod 'ViroReact', :path => '../node_modules/react-viro/ios/'
    pod 'ViroKit', :path => '../node_modules/react-viro/ios/dist/ViroRenderer/'
    pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-async-storage/async-storage'

    pod 'ReactNativeART', :path => '../node_modules/@react-native-community/art'

    pod 'RNCMaskedView', :path => '../node_modules/@react-native-community/masked-view'

    pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'

    pod 'RNCPicker', :path => '../node_modules/@react-native-community/picker'

    pod 'react-native-slider', :path => '../node_modules/@react-native-community/slider'

    pod 'toolbar-android', :path => '../node_modules/@react-native-community/toolbar-android'

    pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

    pod 'react-native-camera', :path => '../node_modules/react-native-camera'

    pod 'react-native-document-picker', :path => '../node_modules/react-native-document-picker'

    pod 'RNFastImage', :path => '../node_modules/react-native-fast-image'

    pod 'RNFS', :path => '../node_modules/react-native-fs'

    pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

    pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'

    pod 'RNPermissions', :path => '../node_modules/react-native-permissions'

    pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

    pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'

    pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context'

    pod 'RNScreens', :path => '../node_modules/react-native-screens'

    pod 'RNShare', :path => '../node_modules/react-native-share'

    pod 'react-native-simple-toast', :path => '../node_modules/react-native-simple-toast'

    pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'

    pod 'RNSVG', :path => '../node_modules/react-native-svg'

    pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

    pod 'react-native-video', :path => '../node_modules/react-native-video'

    pod 'react-native-randombytes', :path => '../node_modules/react-native-randombytes'






    permissions_path = '../node_modules/react-native-permissions/ios'

    pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency.podspec"
    pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral.podspec"
    pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars.podspec"
    pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
    pod 'Permission-Contacts', :path => "#{permissions_path}/Contacts.podspec"
    pod 'Permission-FaceID', :path => "#{permissions_path}/FaceID.podspec"
    # pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy.podspec"
    pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"
    pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse.podspec"
    pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary.podspec"
    pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone.podspec"
    pod 'Permission-Motion', :path => "#{permissions_path}/Motion.podspec"
    pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
    pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary.podspec"
    # pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly.podspec"
    pod 'Permission-Reminders', :path => "#{permissions_path}/Reminders.podspec"
    pod 'Permission-Siri', :path => "#{permissions_path}/Siri.podspec"
    pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition.podspec"
    pod 'Permission-StoreKit', :path => "#{permissions_path}/StoreKit.podspec"







  end

  target 'TilufTests' do
    inherit! :search_paths
    # Pods for testing
  end



end

target 'Tiluf-tvOS' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Tiluf-tvOS



end

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rohitgoyal picture rohitgoyal  路  20Comments

vvsevolodovich picture vvsevolodovich  路  24Comments

al-shivani picture al-shivani  路  25Comments

bithavoc picture bithavoc  路  22Comments

haveamission picture haveamission  路  19Comments