-
Notifications
You must be signed in to change notification settings - Fork 87
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
Compilation errors if flutter module with realm linked to native iOS app #1358
Comments
Hi @TooComplicatedBye! |
Hi @TooComplicatedBye! |
I had a similar error when running [!] /bin/bash -c
set -e
$PROJECT_DIR/Flutter/flutter_export_environment.sh; cd "$FLUTTER_APPLICATION_PATH"; "$FLUTTER_ROOT"/bin/dart run realm install --target-os-type ios --flavor flutter
/bin/bash: line 2: /Flutter/flutter_export_environment.sh: No such file or directory Tweaking the realm.podspec scripts resolved the error above: s.prepare_command = '#{project_dir}/Flutter/flutter_export_environment.sh; cd "$FLUTTER_APPLICATION_PATH"; "$FLUTTER_ROOT"/bin/dart run realm install --target-os-type ios --flavor flutter'
s.script_phases = [
{ :name => 'Download Realm Flutter iOS Binaries',
#Use --debug to debug the install command
:script => '$PROJECT_DIR/../Flutter/flutter_export_environment.sh; cd "$FLUTTER_APPLICATION_PATH"; "$FLUTTER_ROOT\"/bin/dart run realm install --target-os-type ios --flavor flutter',
:execution_position => :before_headers
},
{ :name => 'Report Metrics',
:script => '$PROJECT_DIR/../Flutter/flutter_export_environment.sh; cd "$FLUTTER_APPLICATION_PATH"; "$FLUTTER_ROOT"/bin/dart run realm metrics --flutter-root "$FLUTTER_ROOT" --target-os-type ios --target-os-version "$IPHONEOS_DEPLOYMENT_TARGET"',
:execution_position => :before_compile
}
] |
What happened?
I have a native iOS app with a flutter module. (Path to the flutter module is $PROJECT_DIR/TargetA/FlutterModule) When I add realm to the flutter module and try to compile the whole app I get this error:
PhaseScriptExecution [CP-User]\ Download\ Realm\ Flutter\ iOS\ Binaries
/Users/user/Library/Developer/Xcode/DerivedData/MyProject-croqsfsonryeywhahmmyelbgulpt/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/realm.build/Script-8CDC23D80A80F3E753C4D0E74C40DA89.sh: line 2: /Users/user/myproject-ios/Pods/../Flutter/flutter_export_environment.sh: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code
If I fix the path manually in Pods.xcodeproj(Target: realm) then I get this error:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RealmPlugin", referenced from: objc-class-ref in FlutterPluginRegistrant(GeneratedPluginRegistrant.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Repro steps
Try to compile native iOS app with flutter+realm.
Version
Flutter version: 3.10.6
What Atlas Services are you using?
Local Database only
What type of application is this?
Flutter Application
Client OS and version
macOS 13.0.1
Code snippets
No response
Stacktrace of the exception/crash you're getting
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: