apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

Cannot run new iOS app since latest upgrade #1407

Closed gdorbes closed 1 month ago

gdorbes commented 2 months ago

Bug Report

Problem

Hello,

Since I have upgraded my iPhone to iOS 17.4 and my Mac M1 to Sonoma 14.4 with Xcode 15.3, I not able any longer to run new version of my app on iOS. Nothing else has changed about my app except these elements. I using the latest Cordova with ios@7.0.1.

Deployment and build work fine, but when I try to run the app either on a simulator or a real device, the app is stopped and Xcode console returns the following messages:

Failed to request allowed query parameters from WebPrivacy.
Updated list with error: DownloadFailed.

I did not found details about these messages.

Could you help me?

Thanks

Checklist

SevenSystems commented 2 months ago

I'm getting this in a WKWebView-based app (not Cordova, but in-house framework) on Catalyst. The app seems to work fine, but it does look worrying.

gdorbes commented 1 month ago

My bad: the issue was elsewhere

arlo1990 commented 1 month ago

@gdorbes what was the issue and how did you resolve?

gdorbes commented 1 month ago

The issue was that in my latest app version I requested device info during script loading, before deviceready event. For some timing reason it worked with my android device, but not with my iphone one. I fixed the issue just by moving my request after deviceready.

TejasSatpute077 commented 1 month ago

@gdorbes

I'm also encountering the same issue. Could you please explain how you resolved it in detail?

Jakub-Horacek commented 3 weeks ago

@gdorbes I have the same Issue, could you please provide more detail how have you resolved this issue? I would really appreciate it.

image

TejasSatpute077 commented 3 weeks ago

Hi @Jakub-Horacek , I encountered the exact same issue before, but I managed to resolve it. Could you provide more details about the error you're facing? That way, I can offer you some assistance

Jakub-Horacek commented 2 weeks ago

@TejasSatpute077 Yes, I can try to provide as many details as you need, however I am really newbie iOS developer, so I am not sure what details I need to provide you.

When I launch my app in the simulator, it is stuck on the Launch Screen and the rest of the application is not displayed. There are no errors in the XCode Log. Only the warning mentioned in my previous message.

My app is using Ionic, Cordova, Capacitor and React.

TejasSatpute077 commented 2 weeks ago

@Jakub-Horacek if possible, provide me a screenshot of the page

Jakub-Horacek commented 2 weeks ago

@TejasSatpute077 It is just a blank screen with app logo. image

TejasSatpute077 commented 2 weeks ago

@Jakub-Horacek in your config.xml file set AutoHideSplashScreen as true and clean and build project again

Jakub-Horacek commented 2 weeks ago

@TejasSatpute077 When I set the AutoHideSplashScreen to true, the result is same, but without the logo. 😕 image

TejasSatpute077 commented 2 weeks ago

@Jakub-Horacek in your package.json check required node version mentioned in "engines": { "node": ">=18.18.2 <19" },

and check which version of node you are using on terminal

node -v

and also check cordova version

cordova --version

and

cordova platform ls

Jakub-Horacek commented 2 weeks ago

@TejasSatpute077

There is no

"engines": {
        "node": ">=18.18.2 <19"
      }

in my package.json, however it is MANY times (thousands) in the package.lock.json and each time with different node value. I am currently sing the v20.11.0 node version in my terminal.

I found in my package.json only this information about the cordova: "cordova-plugin-ionic": "5.5.3", and I am using the 12.0.0 (cordova-lib@12.0.1) in my terminal.

TejasSatpute077 commented 2 weeks ago

@Jakub-Horacek

I encountered the same problem you're facing and resolved it by starting fresh with a new setup. Before that, I tried various solutions for the white screen issue and warnings you're experiencing, but none worked. You might want to try a fresh setup, ensuring compatibility with your current Node.js version.

Jakub-Horacek commented 2 weeks ago

@TejasSatpute077 Okay, thank you a lot for your time.

breautek commented 2 weeks ago

NodeJS 20, or any current LTS is sufficient.

A white screen generally means there was a JS error on launch. This often isn't reported in Xcode, but it will be reported in Safari Web Inspector.

I have a guide that details how to use the web inspector. Safari Web Inspector doesn't capture log events that occurred before it was attached, so once attached, use cmd + R with the inspector window focused, it will refresh/reload the webview. Any JS errors on launch occurring should be logged and it should give you more insight on the underlying issue.

Jakub-Horacek commented 2 weeks ago

@TejasSatpute077 So I managed to successfully connect to the Safari inspector for the JSContent as @breautek mentioned in the message above.

And I have these errors and warnings in the inspector: Screenshot 2024-04-30 at 16 51 05

The App is still not working but now I have some more informations, thank you.