Open lake-effect opened 5 years ago
One thing that took me further was adding a symlink in ios/Firebase/Analytics/FirebaseCore.framework/Headers/
inside a folder so we have ios/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore/FirebaseCore.h
(alias).
At this point the build failure is:
/Users/user/project/node_modules/react-native-firebase-mlkit/ios/RNMlKit.m:7:9: fatal error: 'FirebaseMLVision/FirebaseMLVision.h' file not found
#import <FirebaseMLVision/FirebaseMLVision.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you manually include the Firebase SDK in the project_root/ios/Firebase
folder and create the above symlinks, adding the framework-included search path to RNMlKit's xcode project config is sufficient to resolve the first issue:
58B511F11A9E6C8500147676 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
"$(PROJECT_DIR)/../../../ios/Frameworks/**",
"$(PROJECT_DIR)/../../../ios/Firebase/**",
"$(PROJECT_DIR)/../../../ios/Firebase/Analytics/FirebaseCore.framework/Headers/**",
);
After following the above steps to get all the headers included, the symbol architectures don't line up at link time:
ProcessProductPackaging "" /Users/user/project/ios/build/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Project.app.xcent (in target: Project)
cd /Users/user/project/ios
Entitlements:
{
"com.apple.security.get-task-allow" = 1;
}
builtin-productPackagingUtility -entitlements -format xml -o /Users/user/project/ios/build/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Project.app.xcent
ProcessProductPackaging "" /Users/user/project/ios/build/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Project.app-Simulated.xcent (in target: Project)
cd /Users/user/project/ios
Entitlements:
{
"application-identifier" = "9YGM8KGP3S.com.Project";
"aps-environment" = development;
}
builtin-productPackagingUtility -entitlements -format xml -o /Users/user/project/ios/build/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Project.app-Simulated.xcent
Ld /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/Project.app/Project normal x86_64 (in target: Project)
cd /Users/user/project/ios
export IPHONEOS_DEPLOYMENT_TARGET=10.0
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -L/Users/user/project/ios/build/Build/Products/Debug-iphonesimulator -L/Users/user/project/ios -F/Users/user/project/ios/build/Build/Products/Debug-iphonesimulator -F/Users/user/project/ios/Firebase/Analytics -F/Users/user/project/ios/Firebase/InAppMessaging -F/Users/user/project/ios/Firebase/Messaging -filelist /Users/user/project/ios/build/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Objects-normal/x86_64/Project.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=10.0 -Xlinker -object_path_lto -Xlinker /Users/user/project/ios/build/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Objects-normal/x86_64/Project_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/user/project/ios/build/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Project.app-Simulated.xcent -framework MessageUI -framework Social /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTCameraRoll.a -framework Protobuf -framework FirebaseMessaging -framework FirebaseInAppMessaging -framework FirebaseCoreDiagnostics -framework FirebaseCore -framework FirebaseAnalytics -framework GoogleAppMeasurement -framework FIRAnalyticsConnector -framework nanopb -framework FirebaseInstanceID -framework GoogleUtilities /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libReactNativeNavigation.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTBlob.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTAnimation.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libReact.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTAnimation.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTImage.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTLinking.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTText.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTVibration.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libReactNativeCameraKit.a /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRNFetchBlob.a -lRNVectorIcons -lBVLinearGradient -lRNSensitiveInfo /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/libRNDeviceInfo.a -lRNFirebase -lReactNativeFingerprintScanner -lRNCamera -lReactNativeConfig -lRCTVideo -lRNViewShot -lRNShare -lFastImage -lRNMlKit -Xlinker -dependency_info -Xlinker /Users/user/project/ios/build/Build/Intermediates.noindex/Project.build/Debug-iphonesimulator/Project.build/Objects-normal/x86_64/Project_dependency_info.dat -o /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/Project.app/Project
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRVision", referenced from:
objc-class-ref in libRNMlKit.a(RNMlKit.o)
"_OBJC_CLASS_$_FIRVisionImage", referenced from:
objc-class-ref in libRNMlKit.a(RNMlKit.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld /Users/user/project/ios/build/Build/Products/Debug-iphonesimulator/Project.app/Project normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/Project.app
An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Failed to chmod /Users/r634092/Library/Developer/CoreSimulator/Devices/E5B14B56-335E-417F-8209-4525694E4C25/data/Bundle/Application/781B1B77-DEE5-48B9-8A15-5F4E434E5444/Project.app/Project : No such file or directory
Failed to chmod /Users/r634092/Library/Developer/CoreSimulator/Devices/E5B14B56-335E-417F-8209-4525694E4C25/data/Bundle/Application/781B1B77-DEE5-48B9-8A15-5F4E434E5444/Project.app/Project : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
Failed to chmod /Users/r634092/Library/Developer/CoreSimulator/Devices/E5B14B56-335E-417F-8209-4525694E4C25/data/Bundle/Application/781B1B77-DEE5-48B9-8A15-5F4E434E5444/Project.app/Project : No such file or directory
Launching com.Project
com.Project: -1
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "com.Project" failed.
The request was denied by service delegate (SBMainWorkspace) for reason: NotFound ("Application "com.Project" is unknown to FrontBoard").
Underlying error (domain=FBSOpenApplicationErrorDomain, code=4):
The operation couldn’t be completed. Application "com.Project" is unknown to FrontBoard.
Application "com.Project" is unknown to FrontBoard.
@lake-effect Any update of this issue?
I did eventually resolve all this. Let me see if I can summarize my changes and get back to this issue.
Okay, so, I performed the manual iOS configuration steps in the README, followed by these steps:
src/ios/Firebase/
so they are reachable at build time.framework
file to the XCode project file in XCodeprojectWithoutFaceDetection.pbxproj
as given in their docsRNMLKit
XCode project to include the relevant headers from your Firebase folder it needsRNMlkit.xcodeproj
and RNMlKit.xcworkspace
files with those resources imported into them someplace in your source control along with a script to copy them over the old ones at npm postinstall
npm postinstall
. I have something like:`"postinstall": "node ./scripts/android/android-release-gradle-fix.js; cd node_modules/react-native; exec ./scripts/ios-install-third-party.sh; cd third-party/glog-0.3.5; exec ../../scripts/ios-configure-glog.sh; cd ../../../..; exec mlkitconfig/init.sh; react-native link"`
You may recognize some of the calls there, and at this point you should be able to build.
The only open question at that point is adding the header paths to the RNMlkit project each time it's updated, which is a chore.
Hi, the same problem occurs with cocoapods in my environment. #import <FirebaseMLVision/FirebaseMLVision.h>
I think this is not a problem only for manual installation… 🤦♂️
/react-native-firebase-mlkit/ios/RNMlKit.m:7:9: 'FirebaseMLVision/FirebaseMLVision.h' file not found I have in my Podfile this: pod 'Firebase/Core' pod 'Firebase/MLVision' pod 'Firebase/MLVisionLabelModel' pod 'Firebase/MLVisionTextModel'
I have checked that the framework exists in the build and that libRNMLKit.a is added to the link binary with libs and the RNMLKit xcodeproj is in the libs folder for the app.
I don't know what else to check it can't find the header file...
Same error #import <FirebaseMLVision/FirebaseMLVision.h>
when I try to build it. I used react-native link
so it isn't only a manual installation issue as @1natsu172 said. Does anyone know how to fix it?
@fjsandov add $(PROJECT_DIR)/../../../ios/Pods/FirebaseMLVision/Frameworks
to System Framework Search Path
on RNMLkit Project
will solve the problem.
I have to re-add if every time I clean the project and remove node_modules folder
@tienlx91 thank you! it is building the project now, I hope it can be resolved without this manual fix every time you clean the project. Again, thank you @tienlx91. 😄
@tienlx91 I have the same problem but with your information, I could resolve the issue.
what can we do to resolve this situation automatically? Maybe could try to resolve this issue. What do you think?
@mateusc42 any update??
@mateusc42 any update??
I followed the steps in https://github.com/mateusc42/react-native-firebase-mlkit#ios for an iOS manual installation, but when building either from the CLI or in XCode, I get the following error:
libRNFirebase.a is included in the build phases, and react-native itself builds and runs on its own. The error only comes up when I try to add this lib.
Is there a fix that doesn't require cocoapods?