flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

No such module 'UnityFramework' on IOS build

Open Ralegond opened this issue 3 years ago • 13 comments

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

  1. 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!
  1. Create new Unity project on version 2020.3.28f1.
  2. Use setup steps (1 - 6.5).
  3. Use solution from troubleshooting part.
  4. 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

Ralegond avatar Feb 17 '22 13:02 Ralegond

I have same this issue.

  • Flutter: 2.10.2
  • Xcode: 13.2.1
  • Unity: 2020.3.29f1 and 2021.2.12f1

rnd1gh avatar Feb 24 '22 01:02 rnd1gh

same bug

AlexeySpiridonov avatar Mar 02 '22 08:03 AlexeySpiridonov

Try iOS Deployment Target 11.0 over

kilroy80 avatar Mar 03 '22 11:03 kilroy80

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.

lxp-git avatar Mar 04 '22 08:03 lxp-git

any other Solutions here? I have the same Issue and @lxp-git where did you find those Headers and Modules?

khenneken avatar Mar 17 '22 10:03 khenneken

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.

public-1647573949 699555

lxp-git avatar Mar 18 '22 03:03 lxp-git

after you export ios from unity, you need build scheme UnityFramework.framework in Xcode first。

MaoSiUncle avatar Apr 01 '22 08:04 MaoSiUncle

@MaoSiUncle hot do i do that?

khenneken avatar Apr 01 '22 08:04 khenneken

@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.

MaoSiUncle avatar Apr 01 '22 08:04 MaoSiUncle

Guys if you're using Flavors in your app, you need to add them also to UnityProject:

https://pub.dev/packages/unity_widget#flavors

Ahmadre avatar Jun 11 '22 02:06 Ahmadre

In xcode, scheme, you can see UnityFramework.framework, then click Run/Build

I'm not seeing this either

StephenHodgson avatar Feb 10 '23 17:02 StephenHodgson

@MaoSiUncle I tried building scheme UnityFramework.framework in Xcode, but it also fails with error...

Undefined symbol: _OnUnityMessage

ChurikiTenna avatar Jun 27 '23 05:06 ChurikiTenna

same thing happens to me

ngee147 avatar Aug 12 '23 06:08 ngee147