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

When building iOS app "Data parameter is nil" #512

Closed
4 of 5 tasks
olidotjpeg opened this issue Sep 16, 2020 · 11 comments
Closed
4 of 5 tasks

When building iOS app "Data parameter is nil" #512

olidotjpeg opened this issue Sep 16, 2020 · 11 comments
Labels
bug Something isn't working properly ios relates to iOS platform runtime issue An issue related to app runtime

Comments

@olidotjpeg
Copy link

olidotjpeg commented Sep 16, 2020

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:
When we build our app for iOS it doesn't fail but it has this in the build log, and we are curious about what is causing it but can't really figure out what is happening.

I cannot reproduce it in the test repo, but I am out of ideas for what is causing it in my repo.

Expected behavior:
Build passes without errors / warnings

Environment information

  • Cordova CLI version
    • 10.0.0
  • Cordova platform version
    • ios 6.1.1
  • Plugins & versions installed in project (including this plugin)
cordova-plugin-appavailability 0.4.2 "AppAvailability"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-firebasex 11.0.0-cli "Google Firebase Plugin"
cordova-plugin-inappbrowser 4.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-safariviewcontroller 1.6.0 "SafariViewController"
cordova-plugin-splashscreen 6.0.0 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-x-socialsharing 6.0.2 "SocialSharing"
cordova-sqlite-storage 5.0.1 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
cordova.plugins.diagnostic 6.0.2 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-deeplinks 1.0.20 "Ionic Deeplink Plugin"
  • Dev machine OS and version, e.g.
    • OSX
      • 10.15.6

iOS build issue:

  • Node JS version
    • v10.16.3
  • XCode version
    • 11.7

Console output

...Loads of other plugin inits
2020-09-16 16:40:06.834627+0200 AppName[381:26110] Starting Firebase plugin
2020-09-16 16:40:06.841424+0200 AppName[381:26110] FirebasePlugin[native] ERROR: EXCEPTION: data parameter is nil
2020-09-16 16:40:06.841929+0200 AppName[381:26110] [CDVTimer][firebaseplugin] 7.614017ms
2020-09-16 16:40:06.842095+0200 AppName[381:26110] [CDVTimer][TotalPluginStartup] 46.452999ms
2020-09-16 16:40:06.892437+0200 AppName[381:26110] FirebasePlugin[native] LOG: GoogleService-Info.plist found, setup: [FIRApp configureWithOptions]
2020-09-16 16:40:07.170306+0200 AppName[381:26110] [Firebase/Crashlytics] Version 4.6.0
...continued Firebase init

I found a similar issue that got the same error, however that user was using Capacitor, so that issue was closed without much more.

Hope to hear from you, and if there is any more info I can add, please let me know.

@dpa99c
Copy link
Owner

dpa99c commented Sep 16, 2020

If you're unable to reproduce the error in the example project app it could be caused by conflict with another plugin in your project. I suggest adding each plugin you are using in your own project one-at-a-time to the example project and building/running each time to see if the error occurs; in this way you should be able to identify if there is a plugin conflict and which plugin is conflicting with this one.

@dpa99c dpa99c added ios relates to iOS platform more info needed Further information is requested. If not provided, issue will be closed plugin conflict An issue caused by a conflict with another Cordova plugin runtime issue An issue related to app runtime labels Sep 16, 2020
@olidotjpeg
Copy link
Author

Tried you recommendation and removed all plugins, and it's unfortunately still happening.

cordova plugin ls
cordova-plugin-firebasex 11.0.1-cli "Google Firebase Plugin"

@dpa99c
Copy link
Owner

dpa99c commented Sep 17, 2020

Tried you recommendation and removed all plugins

My suggestion is to add the plugins one-at-a-time to the example project not remove them from your own project:

I suggest adding each plugin you are using in your own project one-at-a-time to the example project and building/running each time to see if the error occurs; in this way you should be able to identify if there is a plugin conflict and which plugin is conflicting with this one.

@olidotjpeg
Copy link
Author

Sorry I missed the bit with the example project. I thought you meant to add them one-by-one to my project.

Will try this approach as well.

Again thanks for your response

@olidotjpeg
Copy link
Author

So I tried what you mentioned above with installing all plugins one-by-one into the test project, after each plugin I rebuild through xcode. Still not getting the error.

Then I thought what else could be causing issues, so I tried to make an ionic project from scratch, and then add the firebasex plugin - THIS causes the error. So I guess it might be somewhat related to Ionic.

What I did -

  • Installed Ionic to my global packages
  • Started a project with ionic (Angular version) - Declined ANYTHING with Capacitor
  • Added the iOS platform ionic cordova platform add ios
  • Ran ionic cordova plugin add cordova-plugin-firebasex@latest-cli
  • Added Firebase plist file
  • Ran ionic cordova build ios
  • Opened workspace file and build the xcode project to a Simulator and a Real device
  • The log line now shows in the build log. It doesn't fail the build but it still shows.

Can the log line be ignored perhaps?

@olidotjpeg
Copy link
Author

Anything else I can do to help solve this issue? If yes, then let me know, would love to help as much as I can to make it easier to solve.

@dpa99c
Copy link
Owner

dpa99c commented Sep 21, 2020

Anything else I can do to help solve this issue? If yes, then let me know, would love to help as much as I can to make it easier to solve.

It seems the issue is specific to an Ionic-based Cordova project.
To diagnose the error, you'll need to debug the project in Xcode at run-time to find where the exception is arising and what the cause is.
If you're unable to do this, I will investigate as and when I have time.

@olidotjpeg
Copy link
Author

I appreciate your fast response, I will try to debug it, will return with more if I find anything.

I understand this is a spare time project so I don't wish to rush you, but any help when you have time is very appreciated.

@dpa99c
Copy link
Owner

dpa99c commented Sep 22, 2020

I've had a chance to look at this and it looks like a genuine plugin bug - not specific to Ionic - that was introduced by PR #482:
in the additional code added by that PR, it reads the pn-actions.json file (which defines notification actions) without first checking if that file exists - therefore if it doesn't, an exception is raised here because the value of the data variable is nil.
I'll commit a fix for this.

@dpa99c dpa99c added bug Something isn't working properly and removed more info needed Further information is requested. If not provided, issue will be closed plugin conflict An issue caused by a conflict with another Cordova plugin labels Sep 22, 2020
@dpa99c dpa99c closed this as completed in 02a7f94 Sep 22, 2020
@dpa99c dpa99c added the ready for release Something has been implemented and is awaiting release to npm label Sep 22, 2020
@shinejsf
Copy link

shinejsf commented Sep 23, 2020

@dpa99c When can we expect release of this fix?

@testanddeploy
Copy link

Same problem. Thanks for your work

@dpa99c dpa99c removed the ready for release Something has been implemented and is awaiting release to npm label Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly ios relates to iOS platform runtime issue An issue related to app runtime
Projects
None yet
Development

No branches or pull requests

4 participants