Meteor METEOR@3.0.4 - meteor run ios Throws several errors and warnings

Meteor METEOR@3.0.4 - meteor run ios Throws several errors and warnings

Any recommendations on how to address these is helpful.

Plugins/cordova-plugin-meteor-webapp/Asset.swift:32:7: warning: ‘Hashable.hashValue’ is deprecated as a protocol requirement; conform type ‘Asset’ to ‘Hashable’ by implementing ‘hash(into:)’ instead
var hashValue: Int { return ObjectIdentifier(bundle).hashValue ^ urlPath.hashValue }

Plugins/cordova-plugin-meteor-webapp/AssetBundleManager.swift:1:38: warning: using ‘class’ keyword to define a class-constrained protocol is deprecated; use ‘AnyObject’ instead
protocol AssetBundleManagerDelegate: class {
^~~~~
AnyObject

Plugins/cordova-plugin-meteor-webapp/Asset.swift:32:7: warning: ‘Hashable.hashValue’ is deprecated as a protocol requirement; conform type ‘Asset’ to ‘Hashable’ by implementing ‘hash(into:)’ instead
var hashValue: Int { return ObjectIdentifier(bundle).hashValue ^ urlPath.hashValue }

Plugins/cordova-plugin-meteor-webapp/AssetBundleDownloader.swift:1:41: warning: using ‘class’ keyword to define a class-constrained protocol is deprecated; use ‘AnyObject’ instead
protocol AssetBundleDownloaderDelegate: class {
^~~~~
AnyObject

Plugins/cordova-plugin-meteor-webapp/Asset.swift:32:7: warning: ‘Hashable.hashValue’ is deprecated as a protocol requirement; conform type ‘Asset’ to ‘Hashable’ by implementing ‘hash(into:)’ instead
var hashValue: Int { return ObjectIdentifier(bundle).hashValue ^ urlPath.hashValue }

cordova-build/platforms/ios/mydev_o/Plugins/cordova-plugin-statusbar/CDVStatusBar.m:267:56: warning:
implicit conversion loses integer precision: ‘UIStatusBarStyle’ (aka ‘enum UIStatusBarStyle’) to ‘int’ [-Wshorten-64-to-32]
267 | vc.sb_statusBarStyle = [NSNumber numberWithInt:style];
| ~ ^~~~~

cordova-build/platforms/ios/mydev_o.xcodeproj: warning: The iOS Simulator deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.1.99.

and many such errors,

Try to update to the new beta and let us know if the problem still persists.

meteor update --release 3.1-beta.0

Upgrading to 3.1-beta.0 did not help. Getting the same set of errors.

I have added the following to mobile-config.js file

App.setPreference(‘deployment-target’, ‘12.0’) and this was not being read.

@leonardoventurini - Do you have any suggestions?

Sorry, I can’t think of anything top of mind, not much experience with Cordova, perhaps @nachocodoner might think of something

This issue appears to have been raised earlier Long list of errors with Cordova-IOS on a new app install · Issue #12682 · meteor/meteor · GitHub
@msavin - Did you manage to resolve this problem? If you did, could you please let me know the solution?

Unfortunately had not been able to run it - hopefully there is a fix coming from MDG

I’m not sure why you’re experiencing this. It works well for me on both iOS for Meteor 3 and 2.

Can you share more details about your setup? Which Xcode version are you using? Do you have any other cordova plugins installed (.meteor/cordova-plugins)?

If possible, providing a reproduction repository would help. I can try to replicate your issue and confirm if it’s something I can fix.

Instructions to reproduce

% meteor --version
Meteor 3.0.4

% meteor create mobile-play
% cd mobile-play
% meteor add-platform ios
% meteor run ios

Xcode Version 16.1

Just to clarify, is this a crashing issue for you?

I see some of these warnings too, but my app still functions correctly. I understood that yours doesn’t. While this definitely needs a fix, I’m curious about how critical it is for the rest of us. Does your app still work at all?

Could these warnings be affecting HCP’s functionality? They don’t seem like breaking changes as are warnings, but it’s possible they’re having some impact that I don’t know.

@nachocodoner - Thanks for following up.

In my case after all these warnings, I run into an error.
Here is way to replicate it

Downloaded code from here - examples/cordova at main · meteor/examples · GitHub

% meteor update --release 3.0.4
% meteor run ios

** BUILD FAILED **

=> Errors executing Cordova commands:

While running Cordova app for platform iOS with options
–buildConfig,/Users/meteorcoder/cordova/.meteor/local/cordova-build/build.json,–emulator:
Error: Command failed with exit code 65: xcodebuild -workspace mobileD.xcworkspace -scheme mobileD -configuration
Debug -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 16 Plus build
SYMROOT=/Users/meteorcoder/cordova/.meteor/local/cordova-build/platforms/ios/build
-UseModernBuildSystem=0 -quiet
at makeError
(/Users/meteorcoder/cordova/.meteor/local/cordova-build/node_modules/execa/lib/error.js:60:11)
at handlePromise
(/Users/meteorcoder/cordova/.meteor/local/cordova-build/node_modules/execa/index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at CordovaProject.runCommands (/tools/cordova/project.js:954:14)
at CordovaProject.run (/tools/cordova/project.js:349:5)
at iOSRunTarget.start (/tools/cordova/run-targets.js:32:7)
at /tools/cordova/runner.js:98:11
at Object.capture (/tools/utils/buildmessage.js:282:5)
at CordovaRunner.startRunTargets (/tools/cordova/runner.js:95:24)
at AppRunner._runOnce (/tools/runners/run-app.js:781:7)
at AppRunner._runApp (/tools/runners/run-app.js:951:23)

/Users/meteorcoder/.meteor/packages/meteor-tool/.3.0.4.wn74et.xxa9++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/runners/run-app.js:380
throw e;
^
ExitWithCode { code: 1 }

Node.js v20.18.0

We haven’t updated the Cordova examples yet. That example app is still on Meteor 2.5.2, and I’ve even encountered issues with meteor update --release 3.0.4. Have you run into similar problems on just upgrading?

As part of the effort to update materials for Meteor 3, we’ll ensure those examples are properly updated.

We’ve identified two main issues:

  • Meteor 3 Cordova triggers persistent deprecation warnings with each build. It would be useful to either remove these or determine when they might become breaking changes.
  • Meteor 3 Cordova examples need updating to the latest versions.

To clarify, were you primarily testing Cordova integration in Meteor? In the meantime, I suggest building projects from a fresh Meteor app created with meteor create, then adding platforms (meteor add-platform ios) to test in the simulator later.

Thank you @nachocodoner and team. Thank you for support and guidance.

I had cited the meteor example just to explain the issue I am having with upgrading from version 2 to 3.0.4.

My question is related to migrating an application built on earlier version of meteor to 3.0.4 that also works on cordova. I have an application, that I have migrated to 3.0.4. It is runs on the browser now after converting the sync calls to async but when I try to build it to run as a IOS app it fails.

In case build fails with errors, where can I find the errors and the reason for failure?

** BUILD FAILED **

/Users/meteorcoder/.meteor/packages/meteor-tool/.3.0.4.wn74et.xxa9++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/runners/run-app.js:380
throw e;
^
ExitWithCode { code: 1 }

Node.js v20.18.0

Got it. This crashing scenario is definitely different from the warning issue mentioned above.

Since your app likely has many features, one approach to debug is to gradually remove runtime code. Start with a minimal setup, verify your app visuals appears on your ios app and slowly add code back to find the cause of the issue. This also applies to third-party dependencies like NPM or Atmosphere packages.

To help you further, we would need to replicate the issue on our machines. If possible, create a small reproduction repository. However, following the debugging strategy above might already help you narrow down the problem and gain more insights.

I was going over the logged errors in safari web inspector, these are errors that are showing up. Any advise to help resolve them will be helpful.

This meteor app runs well on the local browser. It is when run on the ios simulator that these errors occur.

[Error] Error: The core-js npm package could not be found in your node_modules
directory. Please run the following command to install it:

meteor npm install --save core-js

module (url.js:38)
fileEvaluate (modules-runtime.js:344)
(anonymous function) (modules.js:322)
evaluateNextModule (core-runtime.js:177)
runEagerModules (core-runtime.js:216)
processNext (core-runtime.js:138)
queue (core-runtime.js:121)
Global Code (url.js:11)

[Error] TypeError: undefined is not an object (evaluating ‘Package[‘accounts-base’].Accounts’)
Global Code (global-imports.js:7)

[Error] ReferenceError: Can’t find variable: meteorInstall
Global Code (app.js:1)

1 Like

Aha! Got it. We’ve identified and fixed this specific issue.

The fix is in this PR, pending verification: Fix Cordova issue when using accounts-base by nachocodoner · Pull Request #13459 · meteor/meteor · GitHub

It will likely be included in the next 3.1 release.

If you’d like to help test it:

  1. Clone the Meteor project: git clone https://github.com/meteor/meteor.git
  2. Switch to the fix branch: git checkout fix-cordova-accounts-url-legacy
  3. Run your Cordova app using the Meteor checkout: <path-to-meteor-checkout>/meteor run ios

Thanks so much!

This appears to be working now. Will update here if something breaks. Thanks for addressing it.

The Meteor 3.1 version with this fix is now available for you to check out.

Update your app with:

meteor update --release 3.1