Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'value' is unavailable: introduced in iOS 12.0 #34106

Closed
orzhtml opened this issue Jun 30, 2022 · 99 comments · Fixed by coinbase/waas-sdk-react-native#25
Closed

'value' is unavailable: introduced in iOS 12.0 #34106

orzhtml opened this issue Jun 30, 2022 · 99 comments · Fixed by coinbase/waas-sdk-react-native#25
Labels

Comments

@orzhtml
Copy link

orzhtml commented Jun 30, 2022

Description

'value' is unavailable: introduced in iOS 12.0

Version

0.69.0

Output of npx react-native info

System:
OS: macOS 10.15.7
CPU: (4) x64 Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
Memory: 27.26 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.17.0/bin/yarn
npm: 8.4.1 - ~/.nvm/versions/node/v14.17.0/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 23, 25, 26, 27, 28, 29, 30
Build Tools: 26.0.2, 26.0.3, 28.0.3, 29.0.2, 29.0.3, 30.0.3
System Images: android-25 | Google APIs ARM EABI v7a, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_152 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.0 => 0.69.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

npx react-native init example --template react-native-template-typescript

yarn start

open xcode run

Snack, code example, screenshot, or link to a repository

image

@friederbluemle
Copy link
Contributor

Same issue here. I'm also using Xcode 12.4 - Could that be the reason?

@AmirDiafi
Copy link

+1

@orzhtml
Copy link
Author

orzhtml commented Jul 4, 2022

My system:
macOS Catalina (10.15.7)
MacBook Pro (13-inch, Mid 2012)

Xcode Version:12.4 (12D4e)

The latest system cannot be upgraded,Could that be the reason?

@datqb
Copy link

datqb commented Jul 4, 2022

same issue, please give me solution when u have. tks

@zhaoaixu520
Copy link

Same with me
macOS Catalina (10.15.7)
Xcode Version:12.4 (12D4e)

@kangfenmao
Copy link

Same issue,

macOS Catalina (10.15.7)
Xcode Version:12.4 (12D4e)

image

@3runoDesign
Copy link

+1

@deep-innow8
Copy link

deep-innow8 commented Jul 5, 2022

  • change the pod files line number 31-37 as
    (comment this line) use_flipper!()

    post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h
    end

  • search IPHONEOS_DEPLOYMENT_TARGET in the whole project and change to 12.4 for every pod as well

hope that works.....

@llVeraVerall
Copy link

I have the same problem. I think the error is that the app runs iOS 14.4

@ammarahm-ed
Copy link

ammarahm-ed commented Jul 9, 2022

Here's how I fixed it:

  1. Open node_modules/react-native/scripts/react_native_pods.rb
  2. Go to line no 401 >>> 'ios' => '11.0',
  3. Change 11.0 to 12.0
  4. Use patch-package to make a patch.
  5. Run yarn
  6. Run pod install
  7. Go to ios/build/generated/ios/React-Codegen.podspec.json and confirm "platforms": { "ios": "12.0" }

That's all.

diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb
index 7f6ebab..cea0fef 100644
--- a/node_modules/react-native/scripts/react_native_pods.rb
+++ b/node_modules/react-native/scripts/react_native_pods.rb
@@ -398,7 +398,7 @@ def get_react_codegen_spec(options={})
     'source' => { :git => '' },
     'header_mappings_dir' => './',
     'platforms' => {
-      'ios' => '11.0',
+      'ios' => '12.0',
     },
     'source_files' => "**/*.{h,mm,cpp}",
     'pod_target_xcconfig' => { "HEADER_SEARCH_PATHS" =>

@craspadotcom
Copy link

craspadotcom commented Jul 9, 2022

this worked, on a brand new project. Ive yet to add packages to see if those run fine. but can you please explain your line of thinking/workflow that made you come to this solution?

edit: after installing packages, project kept on reverting to 11.0. still unable to find a solution

@craspadotcom
Copy link

4. Use patch-package to make a patch.

npx patch-package react-native

@charlieswing
Copy link

+1

I'm getting this on a brand RN new project following the Getting Started instructions. Seems pretty ridiculous we'd have to modify one of the node_module files.

@ammarahm-ed
Copy link

@craspadotcom You have to add the postinstall script in package.json so it patches the files when you install/update packages.

"scripts": {
    "postinstall": "patch-package",
 
  },

The error occurs because React Native 0.69 targets ios 12.4 in Podfile but the Codegen generated podspec still targets ios 11.0 while using ios 12+ apis. I think there should be a patch release that fixes this issue.

@Daniel-Houston
Copy link

This fix worked for me

@OmarUsman777
Copy link

In iOS Folder go to Pods/Pods.xcodeproj/xcuserdata/project.pbxproj

Change all the 'IPHONEOS_DEPLOYMENT_TARGET = 11.0' to 'IPHONEOS_DEPLOYMENT_TARGET = 12.4'. save and run.

Note: every time you pod install it will change so again you have to do it. If there is better approach please do mention.

@Azaz0723
Copy link

In iOS Folder go to Pods/Pods.xcodeproj/xcuserdata/project.pbxproj

Change all the 'IPHONEOS_DEPLOYMENT_TARGET = 11.0' to 'IPHONEOS_DEPLOYMENT_TARGET = 12.4'. save and run.

Note: every time you pod install it will change so again you have to do it. If there is better approach please do mention.

this was helpful my issue was resolved using this

@chrisjoohn
Copy link

chrisjoohn commented Aug 29, 2022

In iOS Folder go to Pods/Pods.xcodeproj/xcuserdata/project.pbxproj

Change all the 'IPHONEOS_DEPLOYMENT_TARGET = 11.0' to 'IPHONEOS_DEPLOYMENT_TARGET = 12.4'. save and run.

Note: every time you pod install it will change so again you have to do it. If there is better approach please do mention.

Thanks for this. After so many tries on how to resolve this issue, this is the one that worked. 🍻

@sesm
Copy link

sesm commented Oct 29, 2022

Update for version 0.70.3:
If you want to follow advice from @ammarahm-ed , the property is in a different file now:

diff --git a/node_modules/react-native/scripts/cocoapods/codegen_utils.rb b/node_modules/react-native/scripts/cocoapods/codegen_utils.rb
index 6fcbb15..7e457b9 100644
--- a/node_modules/react-native/scripts/cocoapods/codegen_utils.rb
+++ b/node_modules/react-native/scripts/cocoapods/codegen_utils.rb
@@ -84,7 +84,7 @@ class CodegenUtils
           'source' => { :git => '' },
           'header_mappings_dir' => './',
           'platforms' => {
-            'ios' => '11.0',
+            'ios' => '12.0',
           },
           'source_files' => "**/*.{h,mm,cpp}",
           'pod_target_xcconfig' => { "HEADER_SEARCH_PATHS" =>

@jhoanborges
Copy link

+1

@kayewrobleski
Copy link

I had the same issue. Advice from @sesm worked for me

@IlirBajrami
Copy link

In iOS Folder go to Pods/Pods.xcodeproj/xcuserdata/project.pbxproj

Change all the 'IPHONEOS_DEPLOYMENT_TARGET = 11.0' to 'IPHONEOS_DEPLOYMENT_TARGET = 12.4'. save and run.

Note: every time you pod install it will change so again you have to do it. If there is better approach please do mention.

You saved my job man! I know this is because our old macs are not updating to the latest ios. Now i hope i earn enough to buy the new mac :)

@hailie-rei
Copy link

@ammarahm-ed 's and @sesm 's solution helped me as well. Thank you!

@kouhot
Copy link

kouhot commented Feb 5, 2023

@OmarUsman777

I think If you set like this in Podfile, you don't have to change them manually everytime.

  ...
  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    # NOTE: Change IPHONEOS_DEPLOYMENT_TARGET to 12.4.
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
      end
    end
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

@samzhao2008
Copy link

In iOS Folder go to Pods/Pods.xcodeproj/xcuserdata/project.pbxproj

Change all the 'IPHONEOS_DEPLOYMENT_TARGET = 11.0' to 'IPHONEOS_DEPLOYMENT_TARGET = 12.4'. save and run.

Note: every time you pod install it will change so again you have to do it. If there is better approach please do mention.

Thank you so much. You saved my day.

@jamesrogers93
Copy link

I fixed this by upgrading react-native from 0.71.4 to 0.71.11

@zachrispoli
Copy link

This issue was fixed for me by bumping react-native from 0.70.6 to 0.70.10, in order to get this fix: c5e549e

So if you're still on react-native 0.70.x, you can still get support for Xcode 14.3 using minor version 10.

@MohameddAmineYaich
Copy link

MohameddAmineYaich commented Jul 10, 2023

I just remove pods folder under ios
then, cd ios
pod install
and it run for me

@PhillipFraThailand
Copy link

The second solution is:

  1. In the Xcode Project select "Pods"
  2. Select target that throws errors
  3. Select Build Settings
  4. Bump iOS Target to required version

But you should do this every time when project is updates

Screenshot 2023-06-15 at 12 29 01

This simple solution worked for me

@expressdev093
Copy link

@OmarUsman777

I think If you set like this in Podfile, you don't have to change them manually everytime.

  ...
  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    # NOTE: Change IPHONEOS_DEPLOYMENT_TARGET to 12.4.
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
      end
    end
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

thanks this work for me

@zabojad
Copy link

zabojad commented Jul 13, 2023

Still having the issue after performing these steps:
1 - upgrade react-native from 0.71.8 to 0.71.12
2 - Deleted Pods and Podfile.lock
3 - run RCT_NEW_ARCH_ENABLED=1 bundle exec pod install in /ios folder
4 - clean build in XCode and build...

Screenshot 2023-07-13 at 17 11 11

@qaudfuture
Copy link

@OmarUsman777
I think If you set like this in Podfile, you don't have to change them manually everytime.

  ...
  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    # NOTE: Change IPHONEOS_DEPLOYMENT_TARGET to 12.4.
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
      end
    end
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

@kouhot 's solution worked for me. Had to add this to Podfile and then Clean and run pod install again, and everything worked without error. Thanks kouhot!

Thank you, This worked for me

@Dsalvat596
Copy link

The second solution is:

  1. In the Xcode Project select "Pods"
  2. Select target that throws errors
  3. Select Build Settings
  4. Bump iOS Target to required version

But you should do this every time when project is updates

Screenshot 2023-06-15 at 12 29 01

You've saved my life. Hours upon hours of trying to fix it, and this did the trick.

@brunoamorim616
Copy link

@OmarUsman777

I think If you set like this in Podfile, you don't have to change them manually everytime.

  ...
  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    # NOTE: Change IPHONEOS_DEPLOYMENT_TARGET to 12.4.
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
      end
    end
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

This worked on my project:
"react": "18.1.0",
"react-native": "0.70.6",
XCode Version 14.3
MacBookAir M1 - MacOS Ventura 13.0

@tonyjohnvan
Copy link

just upgrade react native version to 0.72.3 and pod install fix it for me

JssDWt added a commit to breez/breez-sdk that referenced this issue Aug 4, 2023
The ios example for react native didn't run on xcode 13.4.
Therefore we use this hack
facebook/react-native#34106 (comment)

This can probably be removed once the react native version is upgraded.
mortend added a commit to fusetools/react-native-unity2 that referenced this issue Aug 7, 2023
@holicstudio
Copy link

The second solution is:

  1. In the Xcode Project select "Pods"
  2. Select target that throws errors
  3. Select Build Settings
  4. Bump iOS Target to required version

But you should do this every time when project is updates
Screenshot 2023-06-15 at 12 29 01

You've saved my life. Hours upon hours of trying to fix it, and this did the trick.

Today, what is the required version? ios12? or 16?

@liamjones
Copy link
Contributor

Today, what is the required version? ios12? or 16?

@holicstudio depends on your RN version. For the current version, 0.72.4, it's 12.4: https://github.com/facebook/react-native/blob/v0.72.4/packages/react-native/scripts/react_native_pods.rb#L41

You shouldn't need to manually change the version in the Pods project settings with recent RN versions though, the template Podfile references the above-linked code dynamically (see https://github.com/facebook/react-native/blob/v0.72.4/packages/react-native/scripts/react_native_pods.rb#L41). So, as RN updates, it'll change the version the Pods project is looking for (as long as you remember to pod install after upgrading).

Also, you may have other dependencies that pull up this min required version (for example I believe Expo currently needs 13+ if you're using that in your RN project)

@nqam1904
Copy link

min_ios_version_supported

How to configure only once since the project is updated :-?

hevelius added a commit to pagopa/io-react-native-crypto that referenced this issue Dec 12, 2023
## Short description
This PR updates react-native to resolve an error related to the new
version of xcode. ref:
facebook/react-native#34106

## List of changes proposed in this pull request
- Update package.json
- Update pod

## How to test
Run the example app. It should works correctly
@amruth-k99
Copy link

amruth-k99 commented Jan 20, 2024

I have an Apple Macbook Pro M3 with Xcode 15.3.
If anyone out there is unable to solve it, try this version:
The IPHONEOS_DEPLOYMENT_TARGET should be 13.0. It should be more than 12.4.


target.build_configurations.each do |config|
  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
  if target.name == 'react-native-config'
    config.build_settings['ENVFILE'] = ENVFILES[config.name]
  end
  config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.