Skip to content
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

App crashes when open Unity - iOS #368

Closed
vipatronon opened this issue Mar 30, 2021 · 7 comments
Closed

App crashes when open Unity - iOS #368

vipatronon opened this issue Mar 30, 2021 · 7 comments

Comments

@vipatronon
Copy link

Hey
Whenever I try to open Unity from flutter the app immediately crashes, with no further messages on the console... :(
I'm using flutter_unity_widget: ^4.0.1+1 and the v4 in unity's plugin as well

I've done the Xcode setup a million times, but I still couldn't make it work

image

image

AppDelegate.swift file is the same as the example

Xcode error
image

Any help is welcome

Thx!

@dinesh4official
Copy link

dinesh4official commented Mar 30, 2021

@vipatronon ,

I'm using the same package i.e.flutter_unity_widget: ^4.0.1+1 and the v4 in unity's plugin. I can able to build my application in iPhone.

Unity Editor : 2019.4.22

From the screenshots, I assume that you can build the application and while deploying the application, you are facing this issue. There might be issue with Flutter project (not sure). Could you please try it in a simple application?

Please give a try to open the project from 'Runner.xcworkspace' instead 'Runner.xcodeproj' in XCode. Hope you can find the error log.

@TudorAxinte
Copy link

TudorAxinte commented Mar 30, 2021

I've been getting the exact same issue for a week, on 2 different unity and flutter projects, following the tutorial and all the suggested fixes with no luck. Full error code:

Built from '2019.4/staging' branch, Version '2019.4.9f1 (50fe8a171dd9)', Build type 'Release', Scripting Backend 'il2cpp'
-> applicationDidFinishLaunching()

Setting UIViewControllerBasedStatusBarAppearance to NO is no longer supported.
Apple actively discourages that, and all application-wide methods of changing status bar appearance are deprecated

-> applicationWillEnterForeground()
-> applicationDidBecomeActive()
flutter: *********************************************
flutter: ** flutter unity controller setup complete **
flutter: *********************************************
[Metal Compiler Warning] Warning: Compilation succeeded with:

program_source:45:12: warning: unused variable '_0_prevRect'
float4 _0_prevRect = float4(-1.0, -1.0, -1.0, -1.0);
^
[Metal Compiler Warning] Warning: Compilation succeeded with:

program_source:35:12: warning: unused variable '_tmp_1_inPosition'
float2 _tmp_1_inPosition = (_globals._anonInterface0->ulocalMatrix_Stage0 * float3(_in.inPosition, 1.0)).xy;
^
[Metal Compiler Warning] Warning: Compilation succeeded with:

program_source:40:12: warning: unused variable '_0_prevRect'
float4 _0_prevRect = float4(-1.0, -1.0, -1.0, -1.0);
^
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A13 GPU

  • thread iOS Support #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x5c)
    frame #0: 0x000000010527c250 UnityFramework`-[UnityAppController(self=0x0000000283b6c120, _cmd="callbackGfxInited") callbackGfxInited] at UnityAppController+Rendering.mm:102:43
    99 [_renderDelegate mainDisplayInited: _mainDisplay.surface];
    100 [_unityView recreateRenderingSurface];
    101
    -> 102 _mainDisplay.surface->allowScreenshot = 1;
    ^
    103 }
    104
    105 - (void)callbackPresent:(const UnityFrameStats*)frameStats
    Target 0: (Runner) stopped.
    Lost connection to device.

@dinesh4official
Copy link

dinesh4official commented Mar 30, 2021

Are you experiencing this issue with the latest stable version of flutter?

@TudorAxinte
Copy link

TudorAxinte commented Mar 30, 2021

Are you experiencing this issue with the latest stable version of flutter?

Yes, issue is confirmed on both stable and dev.

flutter: *********************************************
flutter: ** flutter unity controller setup complete **
flutter: *********************************************
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A13 GPU

  • thread iOS Support #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x5c)
    frame #0: 0x0000000104fe4250 UnityFramework`-[UnityAppController(self=0x000000028326d950, _cmd="callbackGfxInited") callbackGfxInited] at UnityAppController+Rendering.mm:102:43
    99 [_renderDelegate mainDisplayInited: _mainDisplay.surface];
    100 [_unityView recreateRenderingSurface];
    101
    -> 102 _mainDisplay.surface->allowScreenshot = 1;
    ^
    103 }
    104
    105 - (void)callbackPresent:(const UnityFrameStats*)frameStats
    Target 0: (Runner) stopped.
    Lost connection to device.
    Tudors-Mac-mini:vinarte tudoraxinte$ flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 2.0.3, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-RO)

@juicycleff
Copy link
Owner

@TudorAxinte you should try building your unity project directly to your phone and test and also disable multi rendering, if enabled

@vipatronon
Copy link
Author

Seems like this was and error with my Unity Project. Fixing that solved my problem. I's odd that I didn't saw any error message...

@andyshephard
Copy link

Did anybody here manage to find a fix for the issue? I'm encountering it now.

`[✓] Flutter (Channel stable, 2.0.5, on macOS 11.2.3 20D91 darwin-arm, locale
en-GB)
• Flutter version 2.0.5 at /Users/andyshephard/fvm/versions/stable
• Framework revision adc687823a (4 weeks ago), 2021-04-16 09:40:20 -0700
• Engine revision b09f014e96
• Dart version 2.12.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/andyshephard/Library/Android/sdk
• Platform android-S, build-tools 30.0.3
• ANDROID_HOME = /Users/andyshephard/Library/Android/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
• 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
1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.56.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.22.0

[✓] Connected device (2 available)
• Andy’s iPhone X (mobile) • 638b72b87e95e957a28f077ef00659f05d234f95 • ios
• iOS 14.4
• Chrome (web) • chrome •
web-javascript • Google Chrome 90.0.4430.212
! Error: Andy’s iPhone X is busy: Making Andy’s iPhone X ready for
development. Xcode will continue when Andy’s iPhone X is finished. (code
-10)

• No issues found!`

Using flutter_unity_view_widget ^4.1.0-null-safe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants