socketsupply / create-socket-app

Create Socket App, is like Create React App but helps you build native apps for mobile and desktop with Svelte, Reactjs, Vuejs and others!
133 stars 14 forks source link

[macos] This app has crashed because it attempted to access privacy-sensitive data without a usage description #28

Closed missinglink closed 1 year ago

missinglink commented 1 year ago

When launching the app (immediately after generating it) on MacOS results in the following dialog:

Screenshot 2023-03-14 at 10 05 56

Selecting 'Reopen' allows the app to launch successfully.

Closing the app and relaunching it results in the same behaviour every time, essentially forcing the user to press 'Reopen' in order to successfully launch the app each time.

Looking at the Report log, the pertinent section is:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothAlwaysUsageDescription key with a string value explaining to the user how the app uses this data.

This is odd since the key seems to be present in the Info.plist file:

grep -C2 NSBluetoothAlwaysUsageDescription ./dist/mac/play-dev.app/Contents/Info.plist
  <key>NSCameraUsageDescription</key>
  <string>This app needs access to the camera</string>
  <key>NSBluetoothAlwaysUsageDescription</key>
  <string>The app would like to discover and connect to peers</string>
  <key>NSMainNibFile</key>

Feels to me like a race condition, I could be way off but shouldn't the writeFile function explicitly call flush()?

missinglink commented 1 year ago

Agh, sorry not flush (which flushes internal buffers to the OS), I meant to say fsync (which tells the OS to flush its buffers to the physical media).

missinglink commented 1 year ago

resolved via RTFM https://sockets.sh/#application-crashes-on-start