No such module 'UnityFramework' on IOS build
Error
No such module 'UnityFramework'
flutter build ipa
Archiving com.ralegond.ajTest...
Automatically signing iOS for device deployment using specified development team in Xcode project: 82KCKT8Q6H
Running Xcode build...
Xcode archive done. 15,2s
Failed to build iOS app
Error output from Xcode build:
↳
** ARCHIVE FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/cq/83nqqzdx48s03f0k0sbgj9y40000gn/T/flutter_tools.zKsSD5/flutter_ios_build_temp_dirEwGcqu/temporary_xcresult_
bundle
/Users/ralegond/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_unity_widget-2020.3.25/ios/Classes/FLTUnityView.swift:10
:8: error: no such module 'UnityFramework'
import UnityFramework
^
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
/Users/ralegond/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_unity_widget-2020.3.25/ios/Classes/FLTUnityView.swift:10
:8: error: no such module 'UnityFramework'
import UnityFramework
^
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in parallel
Result bundle written to path:
/var/folders/cq/83nqqzdx48s03f0k0sbgj9y40000gn/T/flutter_tools.zKsSD5/flutter_ios_build_temp_dirEwGcqu/temporary_xcresult_
bundle
Swift Compiler Error (Xcode): No such module 'UnityFramework'
/Users/ralegond/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_unity_widget-2020.3.25/ios/Classes/FLTUnityView.swift:9:7
Encountered error while archiving for device.
I tried all the solutions from: https://github.com/juicycleff/flutter-unity-view-widget/issues/373 And they did not help me.
Reproduce
- Create new project in flutter.
flutter doctor -v
[✓] Flutter (Channel stable, 2.10.1, on macOS 11.3 20E232 darwin-x64, locale ru-RU)
• Flutter version 2.10.1 at /Users/ralegond/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision db747aa133 (8 days ago), 2022-02-09 13:57:35 -0600
• Engine revision ab46186b24
• Dart version 2.16.1
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/ralegond/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] Android Studio (version 3.1)
• Android Studio at /Volumes/Macintosh HD/Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] VS Code (version 1.64.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.34.0
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.102
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
- Create new Unity project on version 2020.3.28f1.
- Use setup steps (1 - 6.5).
- Use solution from troubleshooting part.
- Use solution from https://github.com/juicycleff/flutter-unity-view-widget/issues/373
Expected behavior Build, archived and upload to testflight.
Versions
- I`m try Unity 2020.3.28f1 and 2019.4.35f1
- Flutter 2.10.1
I have same this issue.
- Flutter: 2.10.2
- Xcode: 13.2.1
- Unity: 2020.3.29f1 and 2021.2.12f1
same bug
Try iOS Deployment Target 11.0 over
Same here. But example DemoApp work well. I copied unity/DemoApp to a new flutter demo project and it works.
I found my UnityFramework.framework folder missing Headers and Modules folders. I copy from a build passed project manually. Temporary fixed.
any other Solutions here? I have the same Issue and @lxp-git where did you find those Headers and Modules?
any other Solutions here? I have the same Issue and @lxp-git where did you find those Headers and Modules?
@kimhenneken By build project flutter-unity-view-widget/example.
after you export ios from unity, you need build scheme UnityFramework.framework in Xcode first。
@MaoSiUncle hot do i do that?
@MaoSiUncle hot do i do that?
In xcode, scheme, you can see UnityFramework.framework, then click Run/Build。 When finished, run Runner to your device.
Guys if you're using Flavors in your app, you need to add them also to UnityProject:
https://pub.dev/packages/unity_widget#flavors
In xcode, scheme, you can see UnityFramework.framework, then click Run/Build
I'm not seeing this either
@MaoSiUncle I tried building scheme UnityFramework.framework in Xcode, but it also fails with error...
Undefined symbol: _OnUnityMessage
same thing happens to me