Build failed Xcode 10 cordova firebase project

纵然是瞬间 提交于 2019-12-11 09:14:34

问题


I'm building a cordova project for iOS and I'm trying to add Firebase SDK. I installed Cocoapods as required, then I installed cordova-plugin-firebasex; I opened my .xcworkspace and changed Build settings in target as follows:

Build settings detail

Then ran pod install in platforms/ios folder, went to the root directory adn typed sudo cordova prepare ios; I updated the window in Xcode 10, went in Build Phases of target and checked the box 'Run scripts only when installing' as follows:

checkbox focus

I also tried to replace the original path, i.e.

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null

became like that:

diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null

anyway I'm getting this error:

/Users/davide/Desktop/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest/Plugins/cordova-plugin-firebasex/AppDelegate+FirebasePlugin.m:3:9: 'Firebase.h' file not found

I tried do remove Podfile.lock and then pod install, tried to do pod deintegrate and pod clean, then again pod install, tried also pod repo update, I'm still stuck and fail to build my project for iOS.

Any suggestions? Thanks, Davide


回答1:


I has the same problem.

The problem was that the file "Firebase.h" was only a link to the real "Firebase.h" that was not installed in Cocoapods libraries. So the problem was with Cocoapods. Even run pod clean, pod install, ecc. didn't resolve, cause nowhere was written to install the libraries.

Then I noticed that the podfile was not correctly configured by the plugin.

So, try to open it (in XCODE, podfile in Pods folder) and verify that is something like:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'your project' do
    project 'your project.xcodeproj'
    pod 'Firebase/Core', '6.3.0'
    pod 'Firebase'
    pod 'Firebase/Auth', '6.3.0'
    pod 'Firebase/Messaging', '6.3.0'
    pod 'Firebase/Performance', '6.3.0'
    pod 'Firebase/RemoteConfig', '6.3.0'
    pod 'Fabric', '1.9.0'
    pod 'Crashlytics', '3.12.0'
end

If not, try to write it manually, then go to your platforms/ios folder and run pod install. Now you can notice that Cocoapods install all the libraries.

I has also some other little problem compiling, but, after this operations, removing the plugin and reinstalling it resolved them.

I hope this can help.



来源:https://stackoverflow.com/questions/57218066/build-failed-xcode-10-cordova-firebase-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!