NativeScript/firebase

Can't build with xcode 14.2 no such module FirebaseMessaging

micBianchi111 opened this issue · 9 comments

    "name": "ros",
    "version": "0.0.1",
    "description": "xxxx",
    "author": "xxxx",
    "scripts": {
        "setup": "npm i && ts-patch install"
    },
    "dependencies": {
        "@nativescript/appversion": "^2.0.0",
        "@nativescript/background-http": "~6.0.0",
        "@nativescript/core": "^8.2.1",
        "@nativescript/datetimepicker": "^2.0.4",
        "@nativescript/fingerprint-auth": "^8.1.0",
        "@nativescript/firebase-core": "^3.1.0",
        "@nativescript/firebase-crashlytics": "^3.1.0",
        "@nativescript/firebase-messaging": "^3.1.0",
        "@nativescript/imagepicker": "~1.0.0",
        "assert": "^2.0.0",
        "axios": "^0.26.1",
        "browserify-zlib": "^0.2.0",
        "buffer": "^6.0.3",
        "child_process": "^1.0.2",
        "crypto-browserify": "^3.12.0",
        "fs": "^0.0.1-security",
        "fs-extra": "^11.1.1",
        "https-browserify": "^1.0.0",
        "moment-timezone": "^0.5.31",
        "nativescript-feedback": "^2.0.0",
        "nativescript-mediafilepicker": "^4.0.1",
        "nativescript-pdf-view": "3.0.0-1",
        "nativescript-statusbar": "^5.0.0",
        "nativescript-theme-core": "^1.0.6",
        "nativescript-ui-autocomplete": "^15.2.3",
        "nativescript-ui-listview": "^15.2.3",
        "nativescript-vue": "~2.9.0",
        "net": "^1.0.2",
        "os-browserify": "^0.3.0",
        "path-browserify": "^1.0.1",
        "stream-browserify": "^3.0.0",
        "stream-http": "^3.2.0",
        "tls": "^0.0.1",
        "tty-browserify": "^0.0.1",
        "typescript": "^5.0.4",
        "url": "^0.11.0",
        "util": "^0.12.4",
        "util-deprecate": "^1.0.2",
        "vue-axios": "^3.4.1",
        "vue-moment": "^4.1.0",
        "vuex": "^3.5.1"
    },
    "devDependencies": {
        "@babel/core": "^7.12.3",
        "@babel/preset-env": "^7.12.1",
        "@nativescript/android": "~8.5.0",
        "@nativescript/ios": "~8.5.1",
        "@nativescript/webpack": "~5.0.5",
        "babel-loader": "^9.1.2",
        "babel-traverse": "6.26.0",
        "babel-types": "6.26.0",
        "babylon": "6.18.0",
        "css-hot-loader": "^1.4.4",
        "lazy": "1.0.11",
        "mini-css-extract-plugin": "^2.7.5",
        "nativescript-toasty": "^3.0.0-alpha.2",
        "nativescript-vue-template-compiler": "~2.9.0",
        "sass": "~1.62.0",
        "ts-patch": "^2.1.0",
        "vue-loader": "^17.0.0"
    },
    "main": "./app/main.js"
}

This is my package.json the app work in simulator and device when i go to make a archive with xcode, my build failed with this error
Screenshot 2023-04-28 alle 18 57 46

any update ?

Suddenly from one day to another, this issue occurs on my side as well.

I use @nativescript/firebase-core, messaging 3.1.0 together with nativescript/core 8.5.2, nativescript/ios 8.5.1 and nativescript/cli 8.5.3.

I upgraded Xcode from 14.2 to 14.3 last week, but I was able to build our app sucessfully yesterday.
I didn't upgrade any plugins or install new plugins.

The only thing I did was a pod repo update.

I already cleared Xcode DerivedData, that did not help.
I tried downgrading nativescript/firebase plugins to 3.0.0 and even down to 2.5.2, that also did not help.

Please any help is much appreciated!

Webpack compilation complete. Watching for file changes.
2023-05-03 11:28:32.259 xcodebuild[17562:6660643] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
/Users/felixkrautschuk/PhpstormProjects/ideafactory/mobile-ng/fanfiktion/node_modules/@nativescript/firebase-messaging/platforms/ios/src/NSCFIRMessagingDelegate.swift:2:8: error: no such module 'FirebaseMessaging'
import FirebaseMessaging
^
/Users/felixkrautschuk/PhpstormProjects/ideafactory/mobile-ng/fanfiktion/node_modules/@nativescript/firebase-messaging/platforms/ios/src/NSCFIRMessagingDelegate.swift:2:8: error: no such module 'FirebaseMessaging'
import FirebaseMessaging
^
error: the following command failed with exit code 1 but produced no further output
SwiftCompile normal x86_64 /Users/felixkrautschuk/PhpstormProjects/ideafactory/mobile-ng/fanfiktion/node_modules/@nativescript/firebase-messaging-core/platforms/ios/src/NSCUNUserNotificationCenterDelegate.swift (in target 'fanfiktion' from project 'fanfiktion')
/Users/felixkrautschuk/PhpstormProjects/ideafactory/mobile-ng/fanfiktion/node_modules/@nativescript/firebase-messaging/platforms/ios/src/NSCFIRMessagingDelegate.swift:2:8: error: no such module 'FirebaseMessaging'
import FirebaseMessaging
^
/Users/felixkrautschuk/PhpstormProjects/ideafactory/mobile-ng/fanfiktion/node_modules/@nativescript/firebase-messaging/platforms/ios/src/NSCFIRMessagingDelegate.swift:2:8: error: no such module 'FirebaseMessaging'
import FirebaseMessaging
^
/Users/felixkrautschuk/PhpstormProjects/ideafactory/mobile-ng/fanfiktion/node_modules/@nativescript/firebase-messaging/platforms/ios/src/NSCFIRMessagingDelegate.swift:2:8: error: no such module 'FirebaseMessaging'
import FirebaseMessaging
^
note: Using codesigning identity override:
note: Building targets in dependency order
note: Run script build phase 'NativeScript PreBuild' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'fanfiktion' from project 'fanfiktion')
note: Run script build phase 'NativeScript PostBuild' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'fanfiktion' from project 'fanfiktion')
note: Run script build phase 'NativeScript PreLink' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'fanfiktion' from project 'fanfiktion')
** BUILD FAILED **

Unable to apply changes on device: C28DBAA2-1829-4E8A-9EE0-C020C7150566. Error is: Command xcodebuild failed with exit code 65.
'pod install' command failed.

@felixkrautschuk i resolve opened .xcworkspace instead .xcodeproj

Without making any changes, it suddenly works again after 2 hours... developing for iOS is so awesome.

Remember to always open .xcworkspace instead of .xcodeproj

I'm getting this error and I am in xcworkspace

I'm getting this error too after updating to XCode 15, I tried xcworkspace and xcodeproj. I'm trying to publish the app to testflight.

I triedns clean, updating packages and pods, cleaning Xcode Derived Data, downgrading. Anyone?

Hi @MATTYGILO and @Dygerydoo did you guys find a solution to this problem?

Solution:

  • in build.xcconfig add
    IPHONEOS_DEPLOYMENT_TARGET = 14.0;

  • in Podfile

platform :ios, '14.0'

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
      config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
    end
  end
end