React native run-ios fails. ios build fails. Android works. Xcode upgraded to 14 is only change - react-native

No code changes on my side. Xcode update happened and now the build fails. Android works just fine. here is the error I get:
** BUILD FAILED **
The following build commands failed:
SwiftEmitModule normal x86_64 Emitting\ module\ for\ Stripe (in target 'Stripe' from project 'Pods')
SwiftCompile normal x86_64 Compiling\ AddPaymentMethodViewController.swift,\ AfterpayPriceBreakdownView.swift,\ Analytic.swift,\ Analytic+Payments.swift,\ APIRequest.swift,\ ApplePayHeaderView.swift,\ Async.swift,\ BackwardsCompatibleColors.swift,\ BillingAddressEditView.swift,\ BottomSheet3DS2ViewController.swift,\ BottomSheetViewController.swift,\ CardDetailsEditView.swift,\ CardScanningView.swift,\ CheckboxButton.swift,\ CheckboxElement.swift,\ ChoosePaymentOptionViewController.swift,\ CircularButton.swift,\ ConfirmButton.swift,\ ContainerView.swift,\ DefaultPaymentMethodStore.swift,\ DimmedView.swift,\ Dropd
package.json:
"#stripe/stripe-react-native": "^0.1.4",
i saw some other folks got this error and it solved for them to update to ios 14.0. i did the same but does not seem to solve my issue. here is my podfile:
platform :ios, '14.0'
xcode version:
Version 14.0.1 (14A400)

Try upgrading stripe to 0.19.0 in package.json, then run "pod update Stripe" in the ios folder.
https://github.com/stripe/stripe-react-native/issues/1183#issuecomment-1299967570

Related

'#kotlin.ExperimentalStdlibApi' or '#OptIn(kotlin.ExperimentalStdlibApi::class)'

e: /Users/abc/update/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (29, 33): This declaration is experimental and its usage must be marked with '#kotlin.ExperimentalStdlibApi' or '#OptIn(kotlin.ExperimentalStdlibApi::class)'
i want to build the native project
Just upgraded to Gradle 7.5.1 and it works. Inside your android directory run:
./gradlew wrapper --gradle-version 7.5.1 --distribution-type=all
#steformicola answer didn't work for me but changing the gradle version in
android/gradle/wrapper/gradle-wrapper.properties
to distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
worked for me.
Look at this link for related issues.

SwiftUI can't run on the device(Alamofire)

I use cocoapods to install alamofire in my project, it works fine in simulator. When I want to run my App on my iphone 6s(ios 13.3.1), it crashed and show the error message. My Xcode version is 11.3.1 (11C504). Is this issue appear due to latest swiftUI project? And is there some way to solve this issue? Please help. Thank you.
dyld: Library not loaded: #rpath/Alamofire.framework/Alamofire
Referenced from: /private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Fitness(SwiftUI)
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=25
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=1
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=1
Below is my Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '13.3.1'
target 'Fitness(SwiftUI)' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Fitness(SwiftUI)
pod 'Alamofire'
pod 'SwiftyJSON', '~> 4.0'
pod 'AlamofireImage', '~> 3.5'
end
There is an open issue:
https://github.com/Alamofire/Alamofire/issues/3051
Seems to happen on ios 13.1.3 with non-developer Apple ID. Right now you can switch to developer Apple ID or remove use_frameworks! from pods (sadly that can make other dependencies throw error)
What fixed this issue in my case was to delete the Apple Development profile from my device and then let Xcode install it again when I ran the app on the device.
General > Device Management > Apple Development ... > tap on it then tap on Delete App. Then when you run again the app one your device the profile will be installed again and you'll be asked to Trust it again.
To be fair, I've also done a pods update.

Detox field CFBundleIdentifier not found inside Info.plist

Following Expo usage guide for detox and getting error below when running detox test.
Using:
"detox": "^10.0.10",
"detox-expo-helpers": "^0.6.0",
"expo-detox-hook": "^1.0.10"
IPA made with :
xcode v 9.4.1
expo v 31.0.6
Also tried IPAs built with xcode v10 and expo v 32.0.0, same error.
Error:
Error: field CFBundleIdentifier not found inside Info.plist of app binary at /Users/admin/Desktop/expo-test/bin/gogonow.app
at SimulatorDriver.getBundleIdFromBinary (/Users/admin/Desktop/expo-test/node_modules/detox/src/devices/drivers/SimulatorDriver.js:70:13)
Try with in the detox configuration
you should take care of .app path, xcodeproj path, Scheme[The app name] and the info.plist path.
This should work..

upgrade to RN 0.56 got error: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'

After upgrade to react-native 0.56(using react-native-git-upgrade ,and update babel-preset-react-native to 5.0.2),
react-native run-ios works fine and app run OK.
But when run react-native run-android, error occur:
/Users/shouhuasun/dev/stage/upgrade-test/mobile-upgrade-test/node_modules/react-native-wechat/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Other names not found such as:'TextAppearance.Material.Widget.Button.Colored,android:keyboardNavigationCluster',etc.
Other libs like react-native-fetch-blob also got the error.
What's the error?
Thanks!
I got the solution(thanks for Reynald Liandra on facebook React-Native Community Q&A):
The react-native-wechat(same other third libs) android module needs to be compiled using sdk 26 after update to rn v0.56.
Open node_modules/react-native-wechat/android/build.gradle ,
change compileSdkVersion to 26, and buildToolsVersion to 26.0.3
Then run react-native run-android and got the correct result.
If there are several third libs , it is noisy to change several build.gradle files.
And if update any libs version (or yarn add new libs),the node_moudle is refreshed and all changes in build.gradle will lost.
you can force gradle use specified sdk version by this(without modify build.gradle in node_modules anymore):
gradle force build tools version on third party libraries
Make sure your npm version is above 8.0

'JSONKit.h' not found when I run 'Test' of my Project in Xcode 5

I used CocoaPods to add JSONKit to project.
Now I want to create a unit test of a function in my project which uses JSONKit function.
When I hit ⌘U to run the test, I got this error message:
I am positive the project can compile can run without problem when I hit ⌘R ('Run')
What is the reason for the error message? How can I fix it?
I am using XCode 5.0.2
It is actually a Pod file setup problem.
I need to add the following as the first line in my podifle.
link_with ['Questions', 'QuestionsTests']
Then rerun pod install and reopen workspace in xcode.