BrainiumLLC / cargo-mobile

Rust on mobile made easy!
Apache License 2.0
1.23k stars 52 forks source link

Cannot run an app on iOS #119

Open v1olen opened 1 year ago

v1olen commented 1 year ago

Reproduction steps

  1. Start new app with cargo mobile init
  2. Choose winit as the template
  3. Plug the iOS device in
  4. Run cargo mobile apple run

Overview

Ran into this issue trying to deploy an app generated from template on iOS

Detected connected device: X’s iPhone (iPhone 11) with target "aarch64-apple-ios"
Building app...
2023-02-05 22:11:16.210 xcodebuild[3096:28320]  DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot1/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-21506/DTDeviceKitBase/DTDKRemoteDeviceData.m:382
Details:  (null) deviceType from 00008030-001529310278C02E was NULL when -platform called.
Object:   <DTDKMobileDeviceToken: 0x7fab3ff3f4d0>
Method:   -platform
Thread:   <NSThread: 0x600001a7f040>{number = 8, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2023-02-05 22:11:16.464 xcodebuild[3096:28448]  DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot1/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-21506/DTDeviceKitBase/DTDKRemoteDeviceData.m:382
Details:  (null) deviceType from 00008030-001529310278C02E was NULL when -platform called.
Object:   <DTDKMobileDeviceToken: 0x7fab3ff3f4d0>
Method:   -platform
Thread:   <NSThread: 0x600001a5e400>{number = 10, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2023-02-05 22:11:16.557 xcodebuild[3096:28448]  DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot1/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-21506/DTDeviceKitBase/DTDKRemoteDeviceData.m:382
Details:  (null) deviceType from 00008030-001529310278C02E was NULL when -platform called.
Object:   <DTDKMobileDeviceToken: 0x7fab3ff3f4d0>
Method:   -platform
Thread:   <NSThread: 0x600001a5e400>{number = 10, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:55DF6743-0493-4DFE-98CB-BE657C8C4B98, OS:16.1, name:iPad (10th generation) }
{ platform:iOS Simulator, id:899F089C-0E95-4136-B8DC-A67FA9BEB4E6, OS:16.1, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:F793355C-09C2-437B-8E87-2DF5C77D6275, OS:16.1, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:82ACCE55-A1CA-4E7E-AC67-97159588C056, OS:16.1, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:65B25A9C-A8C4-42B0-9BBD-C8675BA8BDAE, OS:16.1, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:C72C55B3-7848-420C-8936-273E5ED372A2, OS:16.1, name:iPhone 14 }
{ platform:iOS Simulator, id:3257F8EB-5683-4C84-9282-3C32A516AFF0, OS:16.1, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:B0B65806-DD8F-4043-A761-65789F064F68, OS:16.1, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:39B749DD-1E78-4C08-938A-B1B733D45CD2, OS:16.1, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:BD9C284D-F37F-4445-B879-103D2C817F01, OS:16.1, name:iPhone SE (3rd generation) }
note: Building targets in dependency order
/Users/x/Workspace/dioxus-mobile/gen/apple/dioxus-mobile.xcodeproj: error: Provisioning profile "iOS Team Provisioning Profile: com.example.dioxus-mobile" doesn't include the currently selected device "MacBook Pro (X)" (identifier XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX). (in target 'dioxus-mobile_iOS' from project 'dioxus-mobile')
note: Run script build phase 'Build Rust Code' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'dioxus-mobile_iOS' from project 'dioxus-mobile')
** BUILD FAILED **

error: Failed to build via `xcodebuild`
    Command "xcodebuild -quiet -scheme dioxus-mobile_iOS -workspace
    /Users/x/Workspace/dioxus-mobile/gen/apple/dioxus-mobile.xcodeproj/project.xcworkspace/ -configuration debug -arch arm64
    -allowProvisioningUpdates build" didn't complete successfully, exiting with code 65.

For full context when I start xcode and start a new swift project it runs well on the same device.

What is interesting is that cargo mobile apple list returns:

  [0] X’s iPhone (iPhone 11)

it's available in xcode too; but in the error log above they're devices listed in the middle of the log and the device is not there:

{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:55DF6743-0493-4DFE-98CB-BE657C8C4B98, OS:16.1, name:iPad (10th generation) }
{ platform:iOS Simulator, id:899F089C-0E95-4136-B8DC-A67FA9BEB4E6, OS:16.1, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:F793355C-09C2-437B-8E87-2DF5C77D6275, OS:16.1, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:82ACCE55-A1CA-4E7E-AC67-97159588C056, OS:16.1, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:65B25A9C-A8C4-42B0-9BBD-C8675BA8BDAE, OS:16.1, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:C72C55B3-7848-420C-8936-273E5ED372A2, OS:16.1, name:iPhone 14 }
{ platform:iOS Simulator, id:3257F8EB-5683-4C84-9282-3C32A516AFF0, OS:16.1, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:B0B65806-DD8F-4043-A761-65789F064F68, OS:16.1, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:39B749DD-1E78-4C08-938A-B1B733D45CD2, OS:16.1, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:BD9C284D-F37F-4445-B879-103D2C817F01, OS:16.1, name:iPhone SE (3rd generation) }

Environment

cargo 1.67.0 (8ecd4f20a 2023-01-10) rustc 1.67.0 (fc594f156 2023-01-24) cargo-mobile v0.1.0 Darwin MacBook-Pro-X.local 22.3.0 Darwin Kernel Version 22.3.0: Thu Jan 5 20:49:43 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T8103