Skip to content

MAC APP- Facing error to run release app. Getting Black screen with App Sandbox YES #726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task
yadavsunilmagic opened this issue May 13, 2025 · 3 comments
Assignees
Labels
more info required Needs more info to become actionable. Auto-closed if no response. question How to do something/general question

Comments

@yadavsunilmagic
Copy link

Is there an existing issue?

Build info

Flutter 3.29.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ea121f8859 (5 weeks ago) • 2025-04-11 19:10:07 +0000
Engine • revision cf56914b32
Tools • Dart 3.7.2 • DevTools 2.42.3
Xcode - 16.2

  • Build OS: macOS 15.3.1
  • Deployment OS or device: macOS 15.3.1

Steps to reproduce

1. After setting Xcode Build setting - App Sandbox - YES

Facing error to run release app. Getting Black screen

001-03:14:56.6179 [ERROR] Storage error "Operation not permitted" (code 1)

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: StorageException: failed to create store: Could not open database environment; please check options and file system (1: Operation not permitted) (OBX_ERROR code 10199)

#0 ObjectBoxNativeError.throwMapped (package:objectbox/src/native/bindings/helpers.dart:97)

#1 throwLatestNativeError (package:objectbox/src/native/bindings/helpers.dart:54)

#2 checkObxPtr (package:objectbox/src/native/bindings/helpers.dart:31)

#3 Store._checkStorePointer (package:objectbox/src/native/store.dart:411)

#4 new Store (package:objectbox/src/native/store.dart:230)

#5 StoreRepository.initStore (package:base_app/config/store_repository.dart:23)

#6 main (package:base_app/main.dart:14)

2. And if do Xcode Build setting - App Sandbox - NO
Release build is running and able to generate release build, But getting issue to Upload build on TestFlight for set App Sandbox YES.

Expected behavior

Mac App should run with Sandbox YES and also valid for TestFlight

Actual behavior

Getting Black screen when App Sandbox - YES
001-03:14:56.6179 [ERROR] Storage error "Operation not permitted" (code 1)

Code

import 'dart:io';

import 'package:base_app/objectbox.g.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as path;

import '../utils/app_utils.dart';

/// Repository to initilialize the ObjectBox Store object
class StoreRepository {
late final Store _store;

/// Initializes the ObjectBox Store object.
Future initStore() async {

///For mac, It can not out side of app . So using  getApplicationSupportDirectory for security purpose
if(Platform.isMacOS) {
  final appSupportDir = await getApplicationSupportDirectory();
  AppUtils.documentsDirectoryPath = appSupportDir.path;

  print('storePath - mac1- ${appSupportDir.path}');

  _store = Store(
    getObjectBoxModel(),
    directory: path.join(appSupportDir.path, 'com.magic.macfalcon'),
  );

}else {
  /// fetch and save documents directory path
  final appDocumentsDirectory = await getApplicationDocumentsDirectory();
  AppUtils.documentsDirectoryPath = appDocumentsDirectory.path;

  print('storePath - ios- ${appDocumentsDirectory.path}');

  _store = Store(
    getObjectBoxModel(),
    directory: path.join(appDocumentsDirectory.path, 'mbox-db'),
  );
}


return;

}

/// Getter for the store object.
Store get store => _store;
}

Code
[Paste your code here]

Logs, stack traces

TODO Add relevant logs, a stack trace or crash report.

Logs
[Paste your logs here]
@yadavsunilmagic yadavsunilmagic added the bug Something isn't working label May 13, 2025
@greenrobot-team
Copy link
Member

See the note about sandboxed macOS apps in the Flutter tab of https://docs.objectbox.io/getting-started#create-a-store

Note: I labeled this issue with "more info required" so it will auto-close in a few days if there are no follow-up comments.

@greenrobot-team greenrobot-team self-assigned this May 14, 2025
@greenrobot-team greenrobot-team added question How to do something/general question more info required Needs more info to become actionable. Auto-closed if no response. and removed bug Something isn't working labels May 14, 2025
@yadavsunilmagic
Copy link
Author

yadavsunilmagic commented May 15, 2025

See the note about sandboxed macOS apps in the Flutter tab of https://docs.objectbox.io/getting-started#create-a-store

Note: I labeled this issue with "more info required" so it will auto-close in a few days if there are no follow-up comments.

Hi @greenrobot-team , I did changes according to https://docs.objectbox.io/getting-started#create-a-store
It is running release build in my system.

But when i am uploading to TestFlight. It is giving below error-:

Invalid code signing entitlements. Your application bundle’s signature contains code signing entitlements that aren’t supported on macOS. Specifically, the “[group.XJQAE4L5HQ.mf]” value for the com.apple.security.application-groups key in “com.magic.macfalcon.pkg/Payload/mb_mobile_hybrid_apps.app/Contents/MacOS/mb_mobile_hybrid_apps” isn’t supported. This value should be a string or an array of strings, where each string is the “group” value or your Team ID, followed by a dot (“.”), followed by the group name. If you're using the “group” prefix, verify that the provisioning profile used to sign the app contains the com.apple.security.application-groups entitlement and its associated value(s). (ID: e7524981-8b6c-498d-90d1-da5e897d624a)

My Debug and Release entitlements file as below

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.security.app-sandbox</key>
	<true/>
    <key>com.apple.security.application-groups</key>
    <array>
        <string>group.XJQAE4L5HQ.mf</string>
    </array>
	<key>com.apple.security.cs.allow-jit</key>
	<true/>
	<key>com.apple.security.files.downloads.read-write</key>
	<true/>
	<key>com.apple.security.files.user-selected.read-write</key>
	<true/>
	<key>com.apple.security.network.client</key>
	<true/>
	<key>com.apple.security.network.server</key>
	<true/>
</dict>
</plist>

could you pleas help me into it?

@github-actions github-actions bot removed the more info required Needs more info to become actionable. Auto-closed if no response. label May 16, 2025
@greenrobot-team
Copy link
Member

This value should be a string or an array of strings, where each string is the “group” value or your Team ID, followed by a dot (“.”), followed by the group name.

Sounds like group.XJQAE4L5HQ.mf, specifically .mf, is not a valid value.

@greenrobot-team greenrobot-team added the more info required Needs more info to become actionable. Auto-closed if no response. label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info required Needs more info to become actionable. Auto-closed if no response. question How to do something/general question
Projects
None yet
Development

No branches or pull requests

2 participants