juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.13k stars 518 forks source link

No such module 'UnityFramework' on IOS build #541

Open Ralegond opened 2 years ago

Ralegond commented 2 years ago

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

rnd1gh commented 2 years ago

I have same this issue.

AlexeySpiridonov commented 2 years ago

same bug

kilroy80 commented 2 years ago

Try iOS Deployment Target 11.0 over

lxp-git commented 2 years ago

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.

khenneken commented 2 years ago

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

lxp-git commented 2 years ago

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
MaoSiUncle commented 2 years ago

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

khenneken commented 2 years ago

@MaoSiUncle hot do i do that?

MaoSiUncle commented 2 years ago

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

Ahmadre commented 2 years ago

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

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

StephenHodgson commented 1 year ago

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

I'm not seeing this either

ChurikiTenna commented 1 year ago

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

Undefined symbol: _OnUnityMessage

ngee147 commented 1 year ago

same thing happens to me