Forum Xamarin.Mac

App Store - "No Crash Logs" - How to diagnose?

FelipeMullenFelipeMullen USMember ✭✭
edited February 4 in Xamarin.Mac

I've been working on this issue for a few days now, finally decided to post here for help :(
The App Store has rejected my app 3 times now. Sheesh. How can I diagnose this problem?

My app is simple:

  • Has a single NSWindow that appears when an instance of NSStatusBar (tray icon) is clicked
  • Uses Threading.Timer for scheduling regular wallpaper changes
  • Uses HttpClient to query 2 separate api endpoints
  • Creates a cache folder and writes files at Environment.SpecialFolder.LocalApplicationData
  • The only other library is Newtonsoft.Json for deserialization

I am fairly certain it is not a signing issue:

  • After first rejection, I copied the submitted .pkg file to another mac and got a MacOS crash report signifying a code signing issue
  • After second rejection I found a mistake in my entitlements for com.apple.security.network.client
  • I have checked my app using codesign --verify --verbose=4 MyApp.app and everything checks out

My current flow (building on VS Mac):

  • Build in Release, checked "code signing" for both the app and the .pkg
  • Use Build > Archive for Publishing to archive and sign the package
  • Copy .pkg file to another Macbook for testing
  • Submit to ItunesConnect using Transporter

Responses from the review team have all been the same:

Your app crashed on Mac running macOS 10.15.3 when we:
App crashed on launch.
No crash log was generated by this crash

I am not sure what else I should do at this point, I was hoping I wouldn't have to come crying to the forums for help :cry::lol:
All I can tell you is that I have tested extensively on my build machine as well as my deployment machine. I am targeting MacOS 10.10, building on 10.15.2 and testing on 10.15.1

Posts

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Hmm, that is interesting.

    I'd consider setting up a clean VM of 10.15.3 with nothing installed and try running it there. You could also start your app from the command line:

    ./Foo.app/Contents/MacOS/Foo

    and see if you can get anything useful.

  • FelipeMullenFelipeMullen USMember ✭✭

    Thanks for taking a look @ChrisHamons, I've seen you on multiple threads offering advice for what to do.

    I went through the arduous process of setting up a virtualbox vm using 10.15.3 and my app runs perfectly. My attempts:

    • Copy the signed .app alone and run it as a user would
    • Copy the signed .app alone and run it from terminal
    • Copy the signed .pkg installer and install as user. Run the application.

    All attempts were successful so far. At this point I am wondering if Transporter is corrupting the upload for some reason.

    I'm also considering giving packages a try, although I am not very familiar with the manual codesign commands.

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Hmm, that is strange. That is exactly the setup I'd try.

    If you e-mail me a link to a pkg ([email protected]) I'll see if I can reproduce.

  • FelipeMullenFelipeMullen USMember ✭✭

    I submitted another version to the app store following a very rigorous set of steps to clear everything on my development machine and recreate certs, etc.

    I finally managed to get a report back from the last submission though, and now this is what I have to work with:

    Crashed Thread:        0  Dispatch queue: com.apple.main-thread
    
    Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
    Exception Note:        EXC_CORPSE_NOTIFY
    
    Termination Signal:    Segmentation fault: 11
    Termination Reason:    Namespace SIGNAL, Code 0xb
    Terminating Process:   exc handler [736]
    
    VM Regions Near 0:
    --> 
        __TEXT                 0000000104784000-0000000104bbd000 [ 4324K] r-x/r-x SM=COW  /Applications/Rice Paper.app/Contents/MacOS/Rice Paper
    
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   com.fathoms.mac.ricepaper       0x00000001048c411a mono_arch_create_sdb_trampoline + 122
    1   com.fathoms.mac.ricepaper       0x00000001048ac6ec mini_get_breakpoint_trampoline + 60
    2   com.fathoms.mac.ricepaper       0x0000000104869066 mono_arch_init + 22
    3   com.fathoms.mac.ricepaper       0x00000001048a576a mini_init + 810
    4   com.fathoms.mac.ricepaper       0x00000001048074c3 mono_main + 5875
    5   com.fathoms.mac.ricepaper       0x00000001047bd518 xamarin_main + 1144
    6   com.fathoms.mac.ricepaper       0x00000001047be374 main + 36
    7   libdyld.dylib                   0x00007fff6719b7fd start + 1
    

    Strange that this kind of event doesn't happen in testing. Time to investigate

  • FelipeMullenFelipeMullen USMember ✭✭
    edited February 6

    Worth noting, the difference between my last submission and previous, is that I am now building using the use hardened runtime option.

    EDIT:
    I forgot to add

    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    

    as described in https://devblogs.microsoft.com/xamarin/macos-hardened-runtime-notary/

    :(

    Going to rebuild and resubmit and see what happens

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Yep, that is exactly how it crashes when it can't MAP_JIT memory.

  • FelipeMullenFelipeMullen USMember ✭✭

    After much struggle, and a few rounds of back and forth with the review squad, I was finally able to get through and publish my application.

    I think I have come up with a pretty solid method, so I am going to post it here, maybe it will help others with their own issues. This method involves using the Notary Service provided by Apple to check the binaries before signing for the Apple Store.

    Optional cleanup steps for corrupted files

    1. Remove account from xcode
      XCode > Preferences > Account Tab
    2. Remove development certificates from keychain access
      Under "Keychains" on the left, click on login and remove faulty development certificates
    3. Remove provisioning profiles
      https://stackoverflow.com/questions/26732251/how-to-remove-provisioning-profiles-from-xcode

    Starting from scratch

    1. Create new certs in https://developer.apple.com/

      • Developer ID Application
      • Mac App Distribution
      • Mac Installer Distribution
    2. Import certs into Keychain Access
      Open Keychain Access, file > Import Items...

    3. Add account back into XCode

      • Open XCode
      • Preferences > Accounts
      • Login with your Apple developer ID
      • Click download manual profiles
    4. Open your project in Visual Studio

      • Clean entire solution
      • Manually delete bin/ and obj/ folders
    5. Use your new certs

      • In your Xamarin.Mac project, right-click project and open Options
      • Click on Mac Signing
      • Make sure you are on the Release profile
      • Check "Sign the application bundle"
      • Select your Developer ID Identity (If it isn't there, try restarting VS) Do not use the Automatic features
      • Select None for provisioning profiles
      • Check "Enable Hardened Runtime"
      • Under "Custom Entitlements" use your Entitlements.plist found at your project root
      • Uncheck "Sign the Installer Package"
      • Press "Ok"
    6. Archive your release build for publishing

      • Make sure Release configuration is selected
      • Click Build > Archive for Publishing
      • If any login chain windows come up, put your password in and allow
    7. Notarize application from XCode

      • Open XCode (doesn't need to be from your project, just open it normally)
      • Click on window > organizer
      • You should see your app on the left, click on it
      • Click "Distribute App"
      • Select "Developer ID", click next
      • Select "Upload", click next
      • Select your Developer ID certificate Do not leave it on automatic
      • Select None for profile, click next
      • Review your entitlements, click upload
    8. Submit application to App Store (If you didn't pass Notarization, you shouldn't continue, it won't pass review)

      • Click "Distribute App"
      • Select "App Store Connect"
      • Select "Upload"
      • [YMMV] Check or Uncheck "Upload symbols blah blah" (Mine always says RSync failed, so I uncheck it)
      • Select your Distribution Certificate Do not leave it on automatic
      • Select your Mac Installer Certificate Do not leave it on automatic
      • Select your Provisioning Profile, and click on the 'i' to make sure it allows your entitlements
      • Click next, review
      • Click upload
    9. Cross your fingers and Pray that you did enough testing

    One thing to make sure is that you don't have the word "mac" in ANYTHING associated with your project. I was rejected during one of my reviews because I tend to have a library project and then structure my apps per platform, so I had myApp.Lib and myApp.Mac as projects in Visual Studio. Despite properly configuring the Application Name in options AND in the App Store settings, I was still forced to change the project name, because it shows up in some name configuration on the other side.

    Good luck to all. I can post pictures if needed.

  • RogisterAlainRogisterAlain BEBeta ✭✭✭

    Hi,

    I submitted my application on the AppStore and it is refused by Apple because it crashes directly at launch.

    I can't understand what's going on. The application works perfectly in Debug and Release Mode. I created a package and we tried it on 4 different iMacs and it installs and runs perfectly.

    Obviously, when I compile for the AppStore and I want to launch the application, I have a problem with Code Sign and therefore I cannot really test the application that I have compiled for the AppStore.

    I posted on the forum the crash logs and it looks very much like the problem you had.

    I did not check the "Enable Hardened Runtime" option and therefore I did not put the new lines in Entitlements.plist.

    I have never checked this option before and I have never had such submission problems with Apple.

    It is the first time that I submit the application with Visual Studio 2019 and XCode 9.4.

    I also used XCode to distribute the application to APPLE the first time and since it was refused, I tried Transporter but it's the same. Rejected 4 times .... for the same problem.

    I do not know what to do ?

    Thanks for your help.

    Alain

Sign In or Register to comment.