Detox build with react-native is failing because of GoogleUserMessagingPlatform? - react-native

I cannot get a once-working React-Native Detox build to work. The error seems to start with this:
PhaseScriptExecution [CP]\ Copy\ XCFrameworks /my-project/ios/build/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/GoogleUserMessagingPlatform.build/Script-75B045B5FA23A64D503F12601136A594.sh (in target 'GoogleUserMessagingPlatform' from project 'Pods')
cd /my-project/ios/Pods
/bin/sh -c /my-project/ios/build/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/GoogleUserMessagingPlatform.build/Script-75B045B5FA23A64D503F12601136A594.sh
warning: [CP] Unable to find matching .xcframework slice in '/my-project/ios/Pods/GoogleUserMessagingPlatform/Frameworks/Release/UserMessagingPlatform.xcframework UserMessagingPlatform framework ios-armv7_arm64_arm64e ios-i386_x86_64-simulator' for the current build architectures (arm64 x86_64).
And then towards the end fails with:
ld: warning: directory not found for option '-F/my-project/ios/build/Build/Products/Release-iphonesimulator/XCFrameworkIntermediates/UserMessagingPlatform'
ld: framework not found UserMessagingPlatform
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm on latest of most things - 0.63.3 of RN, CocoaPods 1.10.0, XCode 12.1.

For me, modifying the .detoxrc.json build command to include
EXCLUDED_ARCHS=arm64
ala
"build": "xcodebuild -workspace ios/MyProject.xcworkspace -scheme MyProject -configuration Release -sdk iphonesimulator -derivedDataPath ios/build EXCLUDED_ARCHS=arm64 DETOX=1",

Related

(JS/react-native) How can I solve this error for building react-native app for iOS

Hey guys I'm so new to JS and react-native as well. I was trying to solve this error but I couldn't get it at all! meh
This is what I struggled :
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-ble-plx (to unlink run: "react-native unlink react-native-ble-plx")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
error Could not find the following native modules: RNCAsyncStorage, react-native-ble-plx. Did you forget to run "pod install" ?
info Found Xcode workspace "Sat008.xcworkspace"
info Building (using "xcodebuild -workspace Sat008.xcworkspace -configuration Debug -scheme Sat008 -destination id=61F7DB8A-467A-4027-95C3-B030C17EAA17")
...............
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening Sat008.xcworkspace. Run CLI with --verbose flag for more details.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace Sat008.xcworkspace -configuration Debug -scheme Sat008 -destination id=61F7DB8A-467A-4027-95C3-B030C17EAA17
Prepare build
note: Using legacy build system
=== BUILD TARGET Sat008 OF PROJECT Sat008 WITH CONFIGURATION Debug ===
Check dependencies
The file “Pods-Sat008.debug.xcconfig” couldn’t be opened because there is no such file. (/Users/hyunmincho/Documents/React-Native/SAT_008_DEV/Earthrise-Anders/app/ios/Pods/Target Support Files/Pods-Sat008/Pods-Sat008.debug.xcconfig)
PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/hyunmincho/Library/Developer/Xcode/DerivedData/Sat008-fynygwtjzergqceioiaqjhnwrfbp/Build/Intermediates.noindex/Sat008.build/Debug-iphonesimulator/Sat008.build/Script-D12BA90C2EB97176F46BC0FF.sh
cd /Users/hyunmincho/Documents/React-Native/SAT_008_DEV/Earthrise-Anders/app/ios
/bin/sh -c /Users/hyunmincho/Library/Developer/Xcode/DerivedData/Sat008-fynygwtjzergqceioiaqjhnwrfbp/Build/Intermediates.noindex/Sat008.build/Debug-iphonesimulator/Sat008.build/Script-D12BA90C2EB97176F46BC0FF.sh
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/hyunmincho/Library/Developer/Xcode/DerivedData/Sat008-fynygwtjzergqceioiaqjhnwrfbp/Build/Intermediates.noindex/Sat008.build/Debug-iphonesimulator/Sat008.build/Script-D12BA90C2EB97176F46BC0FF.sh
(1 failure)

React-native - Error on deploy app to xcode - directory not found for option '-L-L/Users/...'

I have a problem on deploy my app to xcode after run command below:
pod install
After run this command, dependencies was installed correctly:
When I tried to compile and deploy again, I had the several erros like this:
1) Target 'XXX' (project 'XXX') has copy command from '/Users/XXX/Documents/projects/react-native/tasks/node_modules/react-native-vector-icons/Fonts/Zocial.ttf' to '/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-bbklwsxeibuqhtduldwfhgorkgcg/Build/Products/Debug-iphonesimulator/XXX.app/Zocial.ttf'
2) That command depends on command in Target 'XXX' (project 'XXX'): script phase “[CP] Copy Pods Resources”
To fix it, I change build system of xcode:
But now, I have the following issue:
ld: warning: directory not found for option '-L-L/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-bbklwsxeibuqhtduldwfhgorkgcg/Build/Products/Debug-iphonesimulator/CocoaAsyncSocket'
ld: library not found for -lCocoaAsyncSocket
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Problem solved with this link:
https://github.com/react-native-community/upgrade-support/issues/36

CocoaPods integration with CommandLineTool and Dylib targets

For test purposes, I created a new project in Xcode as a Command Line tool (Test), added a dylib target called Networking.
Ran the following commands
pod init
In the pod file, under the Networking Target, Removed use_frameworks!
added
pod 'AFNetworking', '~> 2.0'
pod install
After Installation, In BuildPhases of Test CLI, I added Networking dylib. Created a simple method to call AFHTTPRequestOperationManager to test out. Called this method from TestCLI by Importing Networking.h
From Xcode it builds just fine, even archive works just fine from Xcode but when I try to archive from the following command line
xcodebuild -scheme Test -configuration Production archive -archivePath Test.xcarchive
I get the following error
ld: library not found for -lAFNetworking
The following build commands failed: Ld
/Users/user/Library/Developer/Xcode/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/Test/InstallationBuildProductsLocation/usr/local/lib/libNetwork.dylib
normal x86_64 (1 failure)
Any ideas why ?
Try making your build command:
xcodebuild -workspace Test.xcworkspace -scheme Test -configuration Production archive -archivePath Test.xcarchive
I think if you don't specify the workspace setting, xcodebuild would be trying to use your project, which would not contain any Pods or the paths needed for linking.

"xcodebuild" command line is not working as expected in Xcode 7.2 with option "-arch"

The following command line will work perfectly with Xcode 7.1 and Xcode 7.1.1.
xcodebuild clean build -workspace MyProject.xcworkspace -scheme MyProject -sdk iphonesimulator9.2 -arch i386 -configuration Debug
But the above is not working in Xcode 7.2. Its always failed to link libraries with the following error. The issue is with the command line argument -arch.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/<user>/Library/Developer/Xcode/DerivedData/MyProject-clwvgmuubptcujfaauznutwgzbbz/Build/Intermediates/Extensions.build/Debug/Extensions.build/Objects-normal/i386/NSString+Convenience.o /Users/<user>/Documents/workspace/depot/builds/<build_id>/Client/iOS/Platform/Text/Common/NSString/NSString+Convenience.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
If I am not using "-arch" and using "destination" it works. For example the following command line option will work in Xcode 7.2
xcodebuild clean build -workspace MyProject.xcworkspace -scheme MyProject -sdk iphonesimulator9.2 -destination 'platform=iOS Simulator,name=iPhone 6' -configuration Debug
Any idea why this issue in Xcode 7.2? Or its may be an issue in my project. Please help.

xctool tests fail when xcodebuild works - Travis CI

I'm trying to integrate my project into Travis CI, and my builds have failed with the following errors:
Undefined symbols for architecture i386 and Undefined symbols for architecture x86_64
I get these errors for basically every class in my project that hasn't been added to the test target under Target Membership. I could probably solve this by adding every single .m file as a member of the test target, but that doesn't really make much sense, and my
I've tried to replicate this issue locally by running both of the following commands:
xcodebuild -workspace myWorkspace.xcworkspace -scheme MyProjectTests -sdk iphonesimulator build test
xctool -workspace myWorkspace.xcworkspace -scheme MyProjectTests -sdk iphonesimulator build test
Using xcodebuild, it works, runs, and the tests pass. Using xctool the tests fail with the same errors that Travis is using, as Travis uses xctool.
Does anyone have any ideas if there's a best fix for this issue? I assume I missed something somewhere, but I followed the standard Travis 'Getting Started' walkthrough.
After fussing with this a bunch with no luck, it appears as though I'm able to set a custom script for Travis to use instead.. As mentioned, the xcodebuild worked, so I added the following to my travis.yml file and everything was all good:
script:
- xcodebuild -workspace myWorkspace.xcworkspace -scheme MyProjectTests -sdk iphonesimulator build test