在react-native IOS中未检测到权限处理程序

问题描述 投票:0回答:1

[在此处输入图像描述][1]这个错误已经持续了 3-4 天了,我想修复它,但没有任何效果,我已经完成了所有操作,但没有任何效果,这是我的配置:

Podfile:

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")

require 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}

ENV\['RCT_NEW_ARCH_ENABLED'\] = podfile_properties\['newArchEnabled'\] == 'true' ? '1' : '0'
ENV\['EX_DEV_CLIENT_NETWORK_INSPECTOR'\] = podfile_properties\['EX_DEV_CLIENT_NETWORK_INSPECTOR'\]

platform :ios, podfile_properties\['ios.deploymentTarget'\] || '13.0'
install! 'cocoapods',
:deterministic_uuids =\> false

prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.

# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,

# you can also exclude `react-native-flipper` in `react-native.config.js`

# 

# \`\`\`js

# module.exports = {

# dependencies: {

# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),

# }

# }

# \`\`\`

flipper_config = FlipperConfiguration.disabled
if ENV\['NO_FLIPPER'\] == '1' then

# Explicitly disabled through environment variables

flipper_config = FlipperConfiguration.disabled
elsif podfile_properties.key?('ios.flipper') then

# Configure Flipper in Podfile.properties.json

if podfile_properties\['ios.flipper'\] == 'true' then
flipper_config = FlipperConfiguration.enabled(\["Debug", "Release"\])
elsif podfile_properties\['ios.flipper'\] != 'false' then
flipper_config = FlipperConfiguration.enabled(\["Debug", "Release"\], { 'Flipper' =\> podfile_properties\['ios.flipper'\] })
end
end

target 'TrevaShop' do
pod 'Firebase', :modular_headers =\> true
pod 'FirebaseCoreInternal', :modular_headers =\> true
pod 'FirebaseCore', :modular_headers =\> true
pod 'FirebaseMessaging', :modular_headers =\> true
pod 'GoogleUtilities', :modular_headers =\> true
use_expo_modules!
config = use_native_modules!

use_frameworks! :linkage =\> podfile_properties\['ios.useFrameworks'\].to_sym if podfile_properties\['ios.useFrameworks'\]
use_frameworks! :linkage =\> ENV\['USE_FRAMEWORKS'\].to_sym if ENV\['USE_FRAMEWORKS'\]

# Flags change depending on the env values.

flags = get_default_flags()

use_react_native!(
:path =\> config\[:reactNativePath\],
:hermes_enabled =\> podfile_properties\['expo.jsEngine'\] == nil || podfile_properties\['expo.jsEngine'\] == 'hermes',
:fabric_enabled =\> flags\[:fabric_enabled\],
\# An absolute path to your application root.
:app_path =\> "#{Pod::Config.instance.installation_root}/..",
\# Note that if you have use_frameworks! enabled, Flipper will not work if enabled
:flipper_configuration =\> flipper_config
)

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

post_install do |installer|
react_native_post_install(
installer,
config\[:reactNativePath\],
:mac_catalyst_enabled =\> false
)
\__apply_Xcode_12_5_M1_post_install_workaround(installer)

    # This is necessary for Xcode 14, because it signs resource bundles by default
    # when building for devices.
    installer.target_installation_results.pod_target_installation_results
      .each do |pod_name, target_installation_result|
      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
        resource_bundle_target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
    end
    
    permissions_path = '../node_modules/react-native-permissions/ios'
    installer.pods_project.targets.each do |target|
      if target.name == 'RNPermissions'
        target.build_configurations.each do |config|
          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'PERMISSIONS_SERVICE=1'
          config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
          config.build_settings['HEADER_SEARCH_PATHS'] << permissions_path
        end
      end
    end

end

post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue =\> e
Pod::UI.warn e
end
end
end

信息.plist:


<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    NSLocationWhenInUseUsageDescription
    We use your location to provide personalized shopping experiences, show nearby stores, and offer location-based promotions. Your location data is kept secure and never shared with third parties.
    NSLocationAlwaysUsageDescription
    We use your location to provide personalized shopping experiences, show nearby stores, and offer location-based promotions. Your location data is kept secure and never shared with third parties.
    NSLocationAlwaysAndWhenInUseUsageDescription
    We use your location to provide personalized shopping experiences, show nearby stores, and offer location-based promotions. Your location data is kept secure and never shared with third parties.
    GOOGLE_MAPS_API_KEY
    AIzaSyBI8bYXK0GzGBDEc_SCdHQ6RLPLIGDzB1Q
    CFBundleDevelopmentRegion
    $(DEVELOPMENT_LANGUAGE)
    CFBundleExecutable
    $(EXECUTABLE_NAME)
    CFBundleIdentifier
    $(PRODUCT_BUNDLE_IDENTIFIER)
    CFBundleInfoDictionaryVersion
    6.0
    CFBundleName
    $(PRODUCT_NAME)
    CFBundlePackageType
    $(PRODUCT_BUNDLE_PACKAGE_TYPE)
    CFBundleSignature
    ????
    CFBundleShortVersionString
    1.0
    CFBundleVersion
    1
    LSRequiresIPhoneOS
    
    NSAppTransportSecurity
    
        NSAllowsArbitraryLoads
        
        NSExceptionDomains
        
            localhost
            
                NSExceptionAllowsInsecureHTTPLoads
                
            
        
    
    UILaunchStoryboardName
    SplashScreen
    UIRequiredDeviceCapabilities
    
        armv7
    
    UISupportedInterfaceOrientations
    
        UIInterfaceOrientationPortrait
        UIInterfaceOrientationLandscapeLeft
        UIInterfaceOrientationLandscapeRight
    
    UIViewControllerBasedStatusBarAppearance
    
    UIStatusBarStyle
    UIStatusBarStyleDefault
    CADisableMinimumFrameDurationOnPhone
    
    UIAppFonts
    
        Manrope-VariableFont_wght.ttf
        Manrope-Bold.ttf
        Manrope-ExtraBold.ttf
        Manrope-ExtraLight.ttf
        Manrope-Light.ttf
        Manrope-Medium.ttf
        Manrope-Regular.ttf
        Manrope-SemiBold.ttf
    ```


package.json: { “名称”:“特雷瓦肖普”, “版本”:“1.0.0”, “主要”:“index.js”, “脚本”:{ "start": "expo start --dev-client", "android": "世博会运行:android", "ios": "世博会运行:ios", "web": "博览会开始--web", “和”:“npx react-native run-android” }, “依赖项”:{ "@gorhom/bottom-sheet": "^4.6.0", "@react-native-community/async-storage": "^1.12.1", "@react-native-community/geolocation": "^3.1.0", "@react-native-firebase/app": "^19.0.0", "@react-native-firebase/messaging": "^19.0.0", "@react-navigation/native": "^6.1.10", "@react-navigation/stack": "^6.3.21", "axios": "^1.6.5", “base-64”:“^1.0.0”, "世博会": "~49.0.18", "expo-splash-screen": "~0.20.5", "expo-status-bar": "~1.6.0", “反应”:“18.2.0”, “反应本机”:“0.72.6”, "react-native-awesome-alerts": "^2.0.0", "react-native-countdown-component": "^2.7.1", "react-native-date-picker": "^4.3.5", "react-native-default-preference": "^1.4.4", "react-native-gesture-handler": "^2.14.1", "react-native-google-places-autocomplete": "^2.5.6", "react-native-i18n": "^2.0.15", “反应本机线性梯度”:“^2.8.3”, "react-native-maps": "^1.10.0", "react-native-onboarding-swiper": "^1.2.0", "react-native-open-notification": "^0.1.4", "react-native-permissions": "^4.1.4", "react-native-progress": "^5.0.1", "react-native-reanimated": "^3.6.1", "react-native-safe-area-context": "^4.9.0", "react-native-safe-area-view": "^1.1.1", "react-native-screens": "^3.29.0", "react-native-shadow": "^1.2.2", “反应本机骨架占位符”:“^ 5.2.4”, "react-native-svg": "^13.14.0", "react-native-swipe-gestures": "^1.0.5", “反应导航堆栈”:“^2.10.4” }, “开发依赖项”:{ "@babel/core": "^7.20.0" }, “私人”:真实 }


In general, I tried everything, I looked at the fact that there is such a problem everywhere and looked at all the solutions, but they didn’t help at all. I tried everything, but nothing changed.Help me please)


  [1]: https://i.stack.imgur.com/YiYR3.jpg
ios react-native mobile
1个回答
0
投票

之前我遇到过这个错误,如何修复它:

  1. 立即将 React Native 权限升级到版本 4.xx
  2. 运行 Yarn/Npm 安装命令
  3. 然后降级到3.8.4版本还是报错
  4. 纱线安装
  5. 然后 Pod 安装
  6. 然后卸载应用程序并重新安装
© www.soinside.com 2019 - 2024. All rights reserved.