Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.0.1 fails to build on XCode 14.3 #228

Closed
BBosman opened this issue Apr 4, 2023 · 16 comments
Closed

Version 3.0.1 fails to build on XCode 14.3 #228

BBosman opened this issue Apr 4, 2023 · 16 comments

Comments

@BBosman
Copy link

BBosman commented Apr 4, 2023

Bug Report

Version 3.0.1 uses a version of Firebase Messaging (6.32.2) that no longer compiles under XCode 14.3. The version currently on master does (8.1.1), so just releasing that as a new version would fix the issue.

Expected Behaviour

To be able to build an App using the latest published version of this plugin.

Actual Behaviour

It fails to build with "A function declaration without a prototype is deprecated in all versions of C" errors

Reproduce Scenario (including but not limited to)

Steps to Reproduce

  • Update to XCode 16.4
  • Build a Cordova project with the latest published version of this plugin included.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

XCode 14.3

(Android) Device Vendor (e.g. Samsung, HTC, Sony...)

n/a

cordova info Printout

Cordova Packages:

    cli: 11.1.0
        common: 4.1.0
        create: 4.1.0
        lib: 11.1.0
            common: 4.1.0
            fetch: 3.1.0
            serve: 4.0.0

Project Installed Platforms:

    ios: 6.2.0

Project Installed Plugins:

    @havesource/cordova-plugin-push: 4.0.0-dev.0
    cordova-plugin-app-preferences: 0.99.3
    cordova-plugin-app-version: 0.1.12
    cordova-plugin-camera: 6.0.0
    cordova-plugin-device: 2.1.0
    cordova-plugin-file: 7.0.0
    cordova-plugin-geolocation: 4.0.1
    cordova-plugin-inappbrowser: 5.0.0
    cordova-plugin-ionic-keyboard: 2.2.0
    cordova-plugin-media-capture: 4.0.0
    cordova-plugin-remote-injection: 0.5.2
    cordova-plugin-screen-orientation: 3.0.1
    cordova-plugin-statusbar: 2.4.3
    cordova.plugins.diagnostic: 6.1.1

Environment:

    OS: macOS Ventura 13.3 (22E252) (darwin 22.4.0) x64
    Node: v14.19.1
    npm: 8.19.4

ios Environment:

    xcodebuild:
Xcode 14.3
Build version 14E222b


Project Setting Files:

    config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="nl.test.app" ios-CFBundleVersion="5.2.0" version="5.2.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Test</name>
    <description>Test App</description>
    <content src="index.html" />
    <preference name="FCM_VERSION" value="17.0.+" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-intent href="https://*" />
    <engine name="ios" spec="^6.2.0" />
    <platform name="ios">
        <resource-file src="GoogleService-Info.plist" />
    </platform>
    <platform name="ios" />
    <platform name="ios">
        <splash src="res/ios/splash/Default@3x~iphone~anyany.png" />
        <splash src="res/ios/splash/Default@2x~ipad~anyany.png" />
        <splash src="res/ios/splash/Default@2x~iphone~anyany.png" />
        <splash src="res/ios/splash/Default@3x~universal~anyany.png" />
        <splash src="res/ios/splash/Default@2x~universal~anyany.png" />
    </platform>
    <config-file parent="CFBundleDisplayName" platform="ios" target="*-Info.plist">
        <string>Test</string>
    </config-file>
</widget>

    package.json:
--- Start of Cordova JSON Snippet ---
{
  "plugins": {
    "cordova-plugin-device": {},
    "cordova-plugin-statusbar": {},
    "cordova-plugin-app-version": {},
    "@havesource/cordova-plugin-push": {},
    "cordova-plugin-inappbrowser": {},
    "cordova-plugin-ionic-keyboard": {},
    "cordova.plugins.diagnostic": {},
    "cordova-plugin-media-capture": {},
    "cordova-plugin-camera": {},
    "cordova-plugin-file": {},
    "cordova-plugin-screen-orientation": {},
    "cordova-plugin-geolocation": {},
    "cordova-plugin-app-preferences": {},
    "cordova-plugin-remote-injection": {}
  },
  "platforms": [
    "ios"
  ]
}
--- End of Cordova JSON Snippet ---

Sample Push Data Payload

n/a

@kenfouo
Copy link

kenfouo commented Apr 17, 2023

Hello I had the same problem.
Here is my repository:
cordova plugin add github:kenfouo/cordova-plugin-push --save

GitHub. https://github.com/kenfouo/cordova-plugin-push

What I have done :
after migrating to xcode 14.3 I was getting the following error on @havesource/cordova-plugin-push plugin
File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

the plugin embeds Firebase Messaging 6.32.2 except we are already at version 8.1.1

Here is my solution:

  • Download the plugin on github
  • unzip it and go to the plugin.xml file, Line 129
  • Replace $IOS_FIREBASE_MESSAGING_VERSION by 8.1.1
    -Install the plugin manually with the command "cordova plugin add ../cordova-plugin-push"

NB: For installation, make sure the plugin is in the same folder as the project.

Bingo :) it works!!!

@pataar
Copy link

pataar commented Apr 21, 2023

@erisu Any chance in releasing a new version to fix the issue above?

@krem06
Copy link

krem06 commented Apr 30, 2023

Hello @kenfouo, what did you replace line 129 with??? I believe your comment is incomplete right? I tried to update with 6.32.2 but it didn't work so I am wondering if it's the right value.

@kenfouo
Copy link

kenfouo commented May 2, 2023

Bonjour@kenfouo, par quoi avez-vous remplacé la ligne 129 ??? Je pense que votre commentaire est incomplet, n'est-ce pas? J'ai essayé de mettre à jour avec 6.32.2 mais cela n'a pas fonctionné donc je me demande si c'est la bonne valeur.

Replace $IOS_FIREBASE_MESSAGING_VERSION by 8.1.1

@krem06
Copy link

krem06 commented May 3, 2023

Thanks but it was already 8.1.1
https://github.com/havesource/cordova-plugin-push/blob/master/plugin.xml

Let me know if you did change something else, currently I countinue to get errors:

platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'PromisesObjC' from project 'Pods')

@Sachanski
Copy link

I managed to get it to compile by specifying

<plugin name="@havesource/cordova-plugin-push" spec="4.0.0-dev.0" />

I also had to bump the Gradle Kotlin Plugin for android

<preference name="GradlePluginKotlinVersion" value="1.7.10" />

in the config.xml

@gkustas
Copy link

gkustas commented May 16, 2023

Hey thanks @Sachanski - after doing this it resolved the problem, but I still have the following error (I cleaned out the deriveddata folder and tried again with no luck):

rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseCore.framework" "/Users/admin/Library/Developer/Xcode/DerivedData/Fox_Chapel_Racquet_Club-drusoucimkyisuadvuduhvzyrzgh/Build/Intermediates.noindex/ArchiveIntermediates/Fox Chapel Racquet Club/InstallationBuildProductsLocation/Applications/Fox Chapel Racquet Club.app/Frameworks"

building file list ... rsync: link_stat "/Users/admin/develop/cordova_builds/Fox Chapel Racquet Club/platforms/ios/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseCore.framework" failed: No such file or directory (2)
done

I also notice the following warnings. Should the plugin be referencing a newer version of the firebase plugins?

/Users/admin/develop/cordova_builds/Fox Chapel Racquet Club/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'Firebase' from project 'Pods')

/Users/admin/develop/cordova_builds/Fox Chapel Racquet Club/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'nanopb' from project 'Pods')
/Users/admin/develop/cordova_builds/Fox Chapel Racquet Club/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'PromisesObjC' from project 'Pods')

@krem06
Copy link

krem06 commented May 16, 2023

Hi @gkustas, I was actually having those warning that prevented my code to compile for IOS SDK 11.

It's a bit of a pain but you can fix this by changing in from your xcode the problematic pod ios version to 11.

Also, once you fix those version warnings you may get some source code error from your pods, I had to unlock the pod files and fix syntax problems. In my case I just added 'void' inside some function declarations, just search for the error content in google , it was easy to find in my case.

I could compile for IOS SDK >11 after fixing above issues.

@kenfouo
Copy link

kenfouo commented May 17, 2023

it's the version of firebase that is the problem
I fixed the problem here, it worked for me. try this

cordova plugin add github:kenfouo/cordova-plugin-push

@gkustas
Copy link

gkustas commented May 17, 2023

Note that I am now using the dev.0 fork, which fixes the firebase versioning problem. The new problem is with the pods installer. I found the solution (workaround) to it here: https://developer.apple.com/forums/thread/725230

@krem06
Copy link

krem06 commented May 18, 2023

Thanks guys, I will try the push plugin you suggested @kenfouo ASAP!

@MrSpark2591
Copy link

@krem06 if your fork is working can you please raise a pull request and get it merged?

@juniortarcisio
Copy link

juniortarcisio commented Aug 8, 2023

Hi, thank you @kenfouo for sharing an update. I am not deeply familiar with iOS build, but I got 2 bad scenarios here:

  1. Using cordova-ios 6.3, with both versions from "havesource" and "kenfouo", our iOS app asks to allow the push notifications, but I am unable to receive it on iOS.

  2. Using cordova-ios 7 with both versions from "havesource" and "kenfouo", I get the following warning when adding the plugin and the build error:

  • The 'appname' target overrides the 'LD_RUNPATH_SEARCH_PATHS' build settings defined in 'Pods/Target Support files/Pods-app/Pods-app/Pods-app.debug.xconfig'. This can lead to problems with the CacoaPods installation.
  • 'FirebaseCore/FirebaseCore.h' file not found, Could not build module 'Firebase'

Some ideas, will there be an update to this plugin or is there another that worth to migrate?

@pellejero44
Copy link

@juniortarcisio I have the same problem, did you finally manage to solve this problem?

@juniortarcisio
Copy link

@juniortarcisio I have the same problem, did you finally manage to solve this problem?

Hi, solved sometime ago, try to backup the project, remove the ios platform and add again using CLI (cordova platform rm ios, cordova platform add ios). I believe it was some caching issue after exchanging the plugin versions, but not sure.

@erisu
Copy link

erisu commented Oct 23, 2023

Version 4.0.0 was released.
It has the bumped Firebase Messaging library ~> 8.1.1 as suggested. This issue should be resolved.

@erisu erisu closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants