react-native-permissions icon indicating copy to clipboard operation
react-native-permissions copied to clipboard

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

Open smokinjoe opened this issue 9 years ago • 19 comments

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.

smokinjoe avatar Mar 09 '17 18:03 smokinjoe

Same issue here

alanhoff avatar Mar 09 '17 19:03 alanhoff

@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 avatar Mar 09 '17 19:03 smokinjoe

@smokinjoe locking the version to 0.2.5 worked..

npm install --save [email protected]

alanhoff avatar Mar 09 '17 19:03 alanhoff

@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.

smokinjoe avatar Mar 09 '17 19:03 smokinjoe

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 <React/

matthijsdewit avatar Mar 11 '17 20:03 matthijsdewit

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

smokinjoe avatar Mar 14 '17 04:03 smokinjoe

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"

alextkd avatar Mar 17 '17 22:03 alextkd

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 avatar Mar 30 '17 21:03 traylewin

@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

alextkd avatar Mar 31 '17 09:03 alextkd

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

yonahforst avatar Apr 07 '17 15:04 yonahforst

closing for inactivity

yonahforst avatar Apr 20 '17 10:04 yonahforst

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 avatar Oct 11 '17 13:10 kkarmalkar

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

sujitpk-perennial avatar Aug 01 '18 07:08 sujitpk-perennial

Can reopen this issue? I got same error

WesleyFaveri avatar Dec 11 '18 18:12 WesleyFaveri

Same issue here using RN 0.55.4

lucamaraschi avatar Jan 08 '19 15:01 lucamaraschi

same issue using RN 0.58.0

moh3n9595 avatar May 25 '19 06:05 moh3n9595

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 avatar Nov 05 '19 02:11 madelinecameron

@madelinecameron Please submit your Podfile

zoontek avatar Nov 06 '19 09:11 zoontek

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

yashukla47 avatar Dec 30 '20 10:12 yashukla47