gluonhq / gluonfx-maven-plugin

Plugin that simplifies creating native images for Java/JavaFX maven projects
BSD 3-Clause "New" or "Revised" License
186 stars 38 forks source link

gluonfx:nativerun fails on M1 Mac with XCODE 15 and iOS17 #493

Open tmulle opened 9 months ago

tmulle commented 9 months ago

When trying to run the application on my connected iPad using the latest version of Gluon Mobile, I get an error:

I found this link about using XCODE 15 and iOS17 which I am currently using on my mobile devices. I'm also using Sonoma on my M1 Mac.

  1. https://developer.apple.com/forums/thread/731236
  2. https://github.com/ios-control/ios-deploy/issues/588

That second link talks about a workaround of using the apple tools to launch the app. BUT I don't get any log/debug output so I can't see any logging or errors when running my app on my iPad.

The application works fine running on the desktop but fails to run parts on the iPad so I have no way of figuring out what is wrong.

I can manually launch the app on the iPad but tapping on the icon, but I really need debugging/logging to troubleshoot.

[INFO] --- gluonfx-maven-plugin:1.0.21:nativerun (default-cli) @ bcfx ---
[Thu Oct 12 09:27:47 EDT 2023][INFO] ==================== RUN TASK ====================
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] [....] Waiting for iOS device to be connected
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] [....] Using 00008101-000D541104B82C3A (J307AP, iPad Air 4, iphoneos, arm64e, 17.0.3, 21A360) a.k.a. 'Tim’s iPad'.
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] ------ Debug phase ------
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] Starting debug of 00008101-000D541104B82C3A (J307AP, iPad Air 4, iphoneos, arm64e, 17.0.3, 21A360) a.k.a. 'Tim’s iPad' connected through USB...
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] 2023-10-12 09:27:53.975 ios-deploy[81544:2371991] [ !! ] Unable to locate DeviceSupport directory with suffix 'DeveloperDiskImage.dmg'. This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown!
[Thu Oct 12 09:27:53 EDT 2023][INFO] App was launched successfully
tmulle commented 9 months ago

Has anyone else run into this? 2 weeks and not even a comment?

Is anyone using gluonfx with iOS anymore? especially the new versions of the Apple tools?

I can't develop effectively on iOS if I can't debug the application.

Any ideas how I can get debugging/logging working?

jperedadnr commented 9 months ago

The fact that libimobiledevice and iOS-deploy are "broken" with Xcode 15 should give you an idea that this is a major issue. Until they get a fix (or Apple releases a new version of devicectl that allows debug logs), I don't see how we can fix this. I'm personally holding off the migration to Sonoma...

As a possible workaround, though, you could try forwarding all err/out logs to a file that you can see from your app or remotely.

jperedadnr commented 8 months ago

More options: using the Console appp just works...

If you use Attach, you can easily look for AttachLog:

image

and if you set System.setProperty(Constants.ATTACH_DEBUG, "true"); you can look for [DEBUG]:

image

Of course, this only applies to the printouts from the iOS native implementation (Attach one for now, not JavaFX)

cbm64chris commented 7 months ago

It’s not exactly a solution but unless your on Sonoma you can still install Xcode 14. I accidentally upgraded to Sonoma where 14 is nerfed. However, running from the binary in the terminal meant 14 installed the right components that allow iOS-sim deploy etc.

aardy1 commented 5 months ago

It’s not exactly a solution but unless your on Sonoma you can still install Xcode 14. I accidentally upgraded to Sonoma where 14 is nerfed. However, running from the binary in the terminal meant 14 installed the right components that allow iOS-sim deploy etc.

Can you give more details on what you mean here by "running from the binary in the terminal"? Is that on Sonoma?

cbm64chris commented 5 months ago

@aardy1 have you installed Xcode 14? If you have, you'll see that you cannot execute from the app package. However you can execute the Xcode 14 from the binary in the package and it will install everything you need to continue working. Probably at this location: ./Applications/Xcode.app/Contents/MacOS/Xcode

salmonb commented 5 months ago

I have a similar issue on my old iMac 2014 with old macOS (Big Sur 11.7.10), gluonfx:nativerun fails as follow:


[Fri Feb 23 11:31:50 GMT 2024][INFO] ==================== RUN TASK ====================
[Fri Feb 23 11:31:55 GMT 2024][INFO] [SUB] [....] Waiting for iOS device to be connected
[Fri Feb 23 11:31:55 GMT 2024][INFO] [SUB] [....] Using 00008110-000C24D43A84801E (J310AP, iPad mini 6, iphoneos, arm64e, 17.3.1, 21D61) a.k.a. 'iPad mini'.
[Fri Feb 23 11:31:55 GMT 2024][INFO] [SUB] ------ Debug phase ------
[Fri Feb 23 11:31:55 GMT 2024][INFO] [SUB] Starting debug of 00008110-000C24D43A84801E (J310AP, iPad mini 6, iphoneos, arm64e, 17.3.1, 21D61) a.k.a. 'iPad mini' connected through USB...
[Fri Feb 23 11:31:59 GMT 2024][INFO] [SUB] Error: The argument is invalid.
[Fri Feb 23 11:31:59 GMT 2024][INFO] [SUB] 2024-02-23 11:31:59.039 ios-deploy[42911:3478650] [ !! ] Unable to mount developer disk image. (e8000007)
[Fri Feb 23 11:31:59 GMT 2024][INFO] App was launched successfully

brew list --versions gives me the the following libraries versions I'm using:

Am I correct to diagnose from The argument is invalid that the way Gluon calls these libraries is not working anymore with these new versions?

BTW is it the same issue as above, or should I open a different one?

jperedadnr commented 3 months ago

Update: There are some working solutions, outside of ios-deploy (not ready to be integrated with Substrate for now):

see https://github.com/doronz88/pymobiledevice3

These are the steps to get logs on a terminal with lldb:

Follow the following connections steps from LLDB:

(lldb) platform select remote-ios (lldb) target create /path/to/local/application.app (lldb) script lldb.target.module[0].SetPlatformFileSpec(lldb.SBFileSpec('/private/var/containers/Bundle/Application//application.app')) (lldb) process connect connect://[fd85:8523:ce69::1]:53187 <-- ACTUAL CONNECTION DETAILS! (lldb) process launch


- Run from terminal 3:

% lldb (lldb) platform select remote-ios Platform: remote-ios Connected: no SDK Path: "/Users/user/Library/Developer/Xcode/iOS DeviceSupport/iPhone14,8 17.4.1 (21E236)" SDK Roots: [ 0] "/Users/user/Library/Developer/Xcode/iOS DeviceSupport/iPhone14,8 17.4.1 (21E236)" (lldb) target create /path.to/MyApp.app Current executable set to '/path.to/MyApp.app' (arm64). (lldb) script lldb.target.module[0].SetPlatformFileSpec(lldb.SBFileSpec('/private/var/containers/Bundle/Application/22F5DBE4-47E4-475A-8554-5277E85XXXXX/MyApp.app')) True (lldb) process connect connect://[fd85:8523:ce69::1]:53187
(lldb) run Process 709 launched: '/path.to/MyApp.app/MyApp' (arm64) MyApp(709,0x206757f00) malloc: Unable to set up reclaim buffer (46) - disabling large cache determineCpuFeaures Apr 05, 2024 1:28:28 PM com.sun.javafx.application.PlatformImpl startup WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @4563e9ab' IOSWindowSystemInterface : share 0 view 0 pf otready GL_VERSION string = OpenGL ES 2.0 Metal - 99 GL_VERSION (major.minor) = 0.0 initialize() returns 4368422048 IOSWindowSystemInterface : share 2199980 view 0 pf otready GL_VERSION string = OpenGL ES 2.0 Metal - 99 GL_VERSION (major.minor) = 0.0 ... (lldb)exit