ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.16k stars 1.01k forks source link

bug: iOS deployment doesn't work with iOS 15.5 / Xcode 13.4.1 #5908

Closed mariusbolik closed 2 years ago

mariusbolik commented 2 years ago

Version:

naive-run -> 1.6.0 @capacitor/ios -> 3.7.0 @capacitor/core -> 3.7.0

Description:

I updated my iPhone 11 to iOS 15.5 and Xcode to 13.4.1. Sadly, I can't deploy app to my phone anymore. This is the command I used: ionic capacitor run ios --livereload --external. It works when I install the app directly with Xcode on my iPhone.

Command Output:

[capacitor] ✔ Running xcodebuild in 18.18s
[capacitor] 2022-08-22T09:43:04.810Z capacitor:ios:run Invoking native-run with args: [
[capacitor]   'ios',
[capacitor]   '--app',
[capacitor]   '/Users/marius/projects/my-project/my-app/ios/DerivedData/00008101-001648C22200001E/Build/Products/Debug-iphoneos/App.app',
[capacitor]   '--target',
[capacitor]   '00008101-001648C22200001E'
[capacitor] ]
[capacitor] ✖ Deploying App.app to 00008101-001648C22200001E - failed!
[capacitor] [error] 2022-08-22T09:43:04.977Z native-run:ios:lib:client:usbmuxd connectUsbmuxdSocket
[capacitor]         2022-08-22T09:43:04.978Z native-run:ios:lib:client:usbmuxd getDevices
[capacitor]         2022-08-22T09:43:04.978Z native-run:ios:lib:protocol:usbmux socket write: {"messageType":"ListDevices"}
[capacitor]         2022-08-22T09:43:05.255Z native-run:ios:lib:protocol:usbmux Response: {"DeviceList":[{"DeviceID":4,"MessageType":"Attached","Properties":{"ConnectionSpeed":480000000,"ConnectionType":"USB","DeviceID":4,"LocationID":336592896,"ProductID":4776,"SerialNumber":"00008101-001648C22200001E","UDID":"00008101-001648C22200001E","USBSerialNumber":"00008101001648C22200001E"}}]}
[capacitor]         2022-08-22T09:43:05.255Z native-run:ios:lib:client:usbmuxd connectUsbmuxdSocket
[capacitor]         2022-08-22T09:43:05.255Z native-run:ios:lib:client:usbmuxd connect: 4 on port 62078
[capacitor]         2022-08-22T09:43:05.256Z native-run:ios:lib:protocol:usbmux socket write: {"messageType":"Connect","extraFields":{"DeviceID":4,"PortNumber":32498}}
[capacitor]         2022-08-22T09:43:05.260Z native-run:ios:lib:protocol:usbmux Response: {"MessageType":"Result","Number":0}
[capacitor]         2022-08-22T09:43:05.260Z native-run:ios:lib:client:lockdownd getAllValues
[capacitor]         2022-08-22T09:43:05.260Z native-run:ios:lib:protocol:lockdown socket write: {"Request":"GetValue"}
[capacitor]         2022-08-22T09:43:05.295Z native-run:ios:lib:protocol:lockdown Response: {"Request":"GetValue","Value":{"BasebandCertId":3095201109,"BasebandKeyHashInformation":{"AKeyStatus":2,"SKeyHash":{"type":"Buffer","data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"SKeyStatus":0},"BasebandSerialNumber":{"type":"Buffer","data":[101,117,22,132]},"BasebandVersion":"2.54.02","BoardId":10,"BuildVersion":"19F77","CPUArchitecture":"arm64e","ChipID":33025,"DeviceClass":"iPhone","DeviceColor":"1","DeviceName":"Cryptophon von Marius","DieID":6272448118915102,"HardwareModel":"D52gAP","HasSiDP":true,"PartitionType":"GUID_partition_scheme","ProductName":"iPhone OS","ProductType":"iPhone13,1","ProductVersion":"15.5","ProductionSOC":true,"ProtocolVersion":"2","SupportedDeviceFamilies":[1],"TelephonyCapability":true,"UniqueChipID":6272448118915102,"UniqueDeviceID":"00008101-001648C22200001E","WiFiAddress":"fc:66:cf:e4:b5:c4"}}
[capacitor]         2022-08-22T09:43:05.295Z native-run:ios:lib:client:usbmuxd connectUsbmuxdSocket
[capacitor]         2022-08-22T09:43:05.295Z native-run:ios:lib:client:usbmuxd getDevice udid: 00008101-001648C22200001E
[capacitor]         2022-08-22T09:43:05.295Z native-run:ios:lib:client:usbmuxd getDevices
[capacitor]         2022-08-22T09:43:05.295Z native-run:ios:lib:protocol:usbmux socket write: {"messageType":"ListDevices"}
[capacitor]         2022-08-22T09:43:05.297Z native-run:ios:lib:protocol:usbmux Response: {"DeviceList":[{"DeviceID":4,"MessageType":"Attached","Properties":{"ConnectionSpeed":480000000,"ConnectionType":"USB","DeviceID":4,"LocationID":336592896,"ProductID":4776,"SerialNumber":"00008101-001648C22200001E","UDID":"00008101-001648C22200001E","USBSerialNumber":"00008101001648C22200001E"}}]}
[capacitor]         2022-08-22T09:43:05.297Z native-run:ios:lib:client:usbmuxd readPairRecord: 00008101-001648C22200001E
[capacitor]         2022-08-22T09:43:05.297Z native-run:ios:lib:protocol:usbmux socket write: {"messageType":"ReadPairRecord","extraFields":{"PairRecordID":"00008101-001648C22200001E"}}
[capacitor]         2022-08-22T09:43:05.299Z native-run:ios:lib:protocol:usbmux Response: {"PairRecordData":{"type":"Buffer","data":[60,63,120,109,...]

Error without --verbose

[capacitor] ✖ Deploying App.app to 00008101-001648C22200001E - failed!
[capacitor] [error] Error: There was an error installing app
[capacitor]         at /Users/marius/projects/my-project/my-app/node_modules/native-run/dist/ios/lib/client/installation_proxy.js:72:24
[capacitor]         at LockdownProtocolReader.callback (/Users/marius/projects/my-project/my-app/node_modules/native-run/dist/ios/lib/protocol/protocol.js:93:21)
[capacitor]         at LockdownProtocolReader.onData (/Users/marius/projects/my-project/my-app/node_modules/native-run/dist/ios/lib/protocol/protocol.js:53:26)
[capacitor]         at Socket.emit (node:events:390:28)
[capacitor]         at addChunk (node:internal/streams/readable:315:12)
[capacitor]         at readableAddChunk (node:internal/streams/readable:289:9)
[capacitor]         at Socket.Readable.push (node:internal/streams/readable:228:10)
[capacitor]         at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)

Environment Info:

Ionic:

   Ionic CLI                     : 6.20.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.1.14
   @angular-devkit/build-angular : 14.0.6
   @angular-devkit/schematics    : 13.3.7
   @angular/cli                  : 14.0.6
   @ionic/angular-toolkit        : 6.1.0

Capacitor:

   Capacitor CLI      : 3.7.0
   @capacitor/android : 3.7.0
   @capacitor/core    : 3.6.0
   @capacitor/ios     : 3.7.0

Utility:

   cordova-res : 0.15.4
   native-run  : 1.6.0

System:

   NodeJS : v16.13.0 (/usr/local/bin/node)
   npm    : 8.1.0
   OS     : macOS Monterey

macOS version: 12.5

Xcode version: 13.4.1

jcesarmobile commented 2 years ago

This is a duplicate of https://github.com/ionic-team/native-run/issues/241

It's working fine for me with the same Xcode and iOS versions

Syahrul commented 2 years ago

What is the reason for this error and how to fix this? I have the same problem, same error as @mariusbolik My environment information is almost the same as @mariusbolik except I have updated everything to the latest version.

The App can run on device using Xcode but not through ionic cap run ios -l --external but ionic cap run android -l --external is working fine.

Output

[capacitor] [error] Error: There was an error installing app
[capacitor]         at /path-to-project/node_modules/native-run/dist/ios/lib/client/installation_proxy.js:72:24
[capacitor]         at LockdownProtocolReader.callback (/path-to-project/node_modules/native-run/dist/ios/lib/protocol/protocol.js:93:21)
[capacitor]         at LockdownProtocolReader.onData (/path-to-project/node_modules/native-run/dist/ios/lib/protocol/protocol.js:53:26)
[capacitor]         at Socket.emit (node:events:390:28)
[capacitor]         at addChunk (node:internal/streams/readable:315:12)
[capacitor]         at readableAddChunk (node:internal/streams/readable:289:9)
[capacitor]         at Socket.Readable.push (node:internal/streams/readable:228:10)
[capacitor]         at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)
[capacitor]         
[ERROR] An error occurred while running subprocess capacitor.

        capacitor run ios --no-sync --target cb6c3d5e67e31c13697823c57648f461a903a66d exited with exit code 1.
mariusbolik commented 2 years ago

I also get this error with iOS 16 and Xcode 14. But only on my 2015 iMac. Not on my newer MacBook (Intel). On the MacBook it works without any problem.

Syahrul commented 2 years ago

I fix this by deleting folder DerivedData in /your-project/ios folder. Does this fix work for you @mariusbolik ?

mariusbolik commented 2 years ago

@Syahrul This actually fixed the problem. Many thanks for that! 🎉

The only issue I still have is that the app opens briefly and then closes again immediately. I then have to open it again manually. But I can live with that.

ionitron-bot[bot] commented 1 year ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.