I'm not respecting the template, but I wanted to make a suggestion for the issue : #434
Invalid RNPermission X. Should be one of: ()
In my case I鈥檓 using use_frameworks! and by adding only Permission-LocationAlways, I was still having the issue, but then I added RNPermissions too and then it worked
Here is the end of my Podfile :
$static_framework = [
'RNVectorIcons', 'RNFBAnalytics', 'RNFBApp', 'RNPermissions', 'Permission-LocationAlways'
]
pre_install do |installer|
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
use_native_modules!
end
Maybe try it with other permissions and update the README if it's working.
@Daavidaviid This is totally identical to what's in already in the README, no? https://github.com/react-native-community/react-native-permissions#workaround-for-use_frameworks-issues (RNPermissions don't need be statically linked)
I was actually having this issue, but as it is in README.md, under ios, I had to put in Podfile
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse.podspec"
and it worked
@LMestre14 The latest version has a more explicit error for this 馃檪

Sorry I wasn't very explicit. I added RNPermissions to static frameworks in Podfile.
And I just tested again and I can confirm that with version 2.0.9 on my machine, the iOS build fails if I don't add RNPermissions and only add Permission-LocationAlways to static frameworks.
@Daavidaviid what's your react-native version?
0.62
I'm using 0.61.5
In my Podfile I don't have $static_framework as you have on yours, because supposedly native components like react-native-permissions should only be installed (yarn or npm) and right after run command pod install in the projects ios folder.
I don't understand why you need $static_framework in the first place
@LMestre14 Because he uses use_frameworks! and currently Cocoapods don't provide a proper way to define a Podspec as a static library.
@Daavidaviid I just tried without RNPermissions linked as static framework and can confirm it's not needed (only the permission handlers is enough).
It might be related to something else (Xcode cache stale data? Try to remove RNPermissions for $static_framework, nuke the Xcode DerivedData folder, delete your Pods folder, run pod install and rebuild your app.
Ok, I just cleaned the build in Xcode everytime. I鈥檒l try with DerivedData folder later. Also, LocationAlways is the only permission I use, don鈥檛 know if it could be linked.
I upgraded to 2.1.0 today and now I get the error screen as in https://github.com/react-native-community/react-native-permissions/issues/441#issuecomment-612861024, even that it was working on 2.0.10. I don't use use_frameworks. I tried to clean everything (deriviedData, simulator etc) but didn't help.
@radko93 Please provide more informations (OS?, RN version? permission handlers linked? Xcode DerivedData / Gradle cache cleaned?)
platform :ios, '11.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
def add_flipper_pods!(versions = {})
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'
pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'
# List all transitive dependencies for FlipperKit pods
# to avoid them being linked in Release builds
pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
file_name = Dir.glob("*.xcodeproj")[0]
app_project = Xcodeproj::Project.open(file_name)
app_project.native_targets.each do |target|
target.build_configurations.each do |config|
cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
cflags << '-DFB_SONARKIT_ENABLED=1'
end
config.build_settings['OTHER_CFLAGS'] = cflags
end
app_project.save
end
installer.pods_project.save
end
# Pods for Blossom
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
# Permissions
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
post_install do |installer|
flipper_post_install(installer)
end
target "App" do
use_native_modules!
add_flipper_pods!
end
target "App2" do
use_native_modules!
add_flipper_pods!
end
@radko93 Thanks, it helped a lot! I see what this is: you only use the notification permission handler which is a bit different from the others (for the specific functions checkNotifications / requestNotifications) and the header file check is missing in the new startup check (it's here, and I copied this list). I will add it and publish a new release.
@zoontek great will check it out once released.
@radko93 It has been published. Sorry for the inconvenience.
@zoontek You saved my life, thanks, now everything works as expected.
Erratum: Just tried it with a fresh new project, RNPermissions need effectively to be linked as a static library too. I added it to the README.
Most helpful comment
@LMestre14 Because he uses
use_frameworks!and currently Cocoapods don't provide a proper way to define a Podspec as a static library.