Skip to content

il2cpp error when building with version ^3.0.1 #273

@OGmetamonkey

Description

@OGmetamonkey

Describe the bug
Tried upgrading to the latest implementation of the flutter unity widget. Previous working implementation was ^0.1.6+8. Getting errors related to il2cpp.

To Reproduce
Steps to reproduce the behavior:

  1. Add flutter_unity_widget: ^3.0.1 to the flutter project as specified in the read me, including the addition of 'FlutterUnityPackage-3.0.0.unitypackage.
  2. Open in Unity and build to Android
  3. Try to build the flutter project to android device in debugger mode.

Expected behavior
Expected the app to build successfully as it did when using flutter unity widget version ^0.1.6+8

Versions
Flutter: 1.22.5
Dart: 2.10.4
Flutter unity widget: 3.0.1
Unity: 2020.1.16f1
Unity Hub: 2.4.2
Android Device: Nexus 5x using Android 8.1.0

Debug Log

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Launching lib/main.dart on Nexus 5X in debug mode...
lib/main.dart
Running il2cpp.exe in workstation GC mode.
il2cpp.exe didn't catch exception: System.Exception: Android NDK r19 or newer not detected at 'null'.
at Unity.IL2CPP.Building.ToolChains.Android.AndroidNDKUtilities..ctor (NiceIO.NPath ndkRootPath, Unity.IL2CPP.Common.Architecture architecture, System.Boolean useDependenciesToolChain) [0x00078] in :0
at Unity.IL2CPP.Building.ToolChains.AndroidToolChain..ctor (Unity.IL2CPP.Common.Architecture architecture, Unity.IL2CPP.Building.BuildConfiguration buildConfiguration, System.Boolean treatWarningsAsErrors, System.Boolean assemblyOutput, System.Boolean useDependenciesToolChain, NiceIO.NPath toolchainPath) [0x00008] in :0
at Unity.IL2CPP.Building.Platforms.AndroidPlatformSupport.MakeCppToolChain (Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x00000] in :0
at il2cpp.Compilation.CompilationDriver.Run (Unity.IL2CPP.Common.RuntimePlatform platform, Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x000c0] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.DoRun (System.String[] args, Unity.IL2CPP.Common.RuntimePlatform platform, Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x0001f] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.Run (System.String[] args, System.Boolean setInvariantCulture) [0x00063] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.Main (System.String[] args) [0x00000] in <3be9f628f5fa469389bd6a91a579ba8a>:0

Unhandled Exception:
System.Exception: Android NDK r19 or newer not detected at 'null'.
at Unity.IL2CPP.Building.ToolChains.Android.AndroidNDKUtilities..ctor (NiceIO.NPath ndkRootPath, Unity.IL2CPP.Common.Architecture architecture, System.Boolean useDependenciesToolChain) [0x00078] in :0
at Unity.IL2CPP.Building.ToolChains.AndroidToolChain..ctor (Unity.IL2CPP.Common.Architecture architecture, Unity.IL2CPP.Building.BuildConfiguration buildConfiguration, System.Boolean treatWarningsAsErrors, System.Boolean assemblyOutput, System.Boolean useDependenciesToolChain, NiceIO.NPath toolchainPath) [0x00008] in :0
at Unity.IL2CPP.Building.Platforms.AndroidPlatformSupport.MakeCppToolChain (Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x00000] in :0
at il2cpp.Compilation.CompilationDriver.Run (Unity.IL2CPP.Common.RuntimePlatform platform, Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x000c0] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.DoRun (System.String[] args, Unity.IL2CPP.Common.RuntimePlatform platform, Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x0001f] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.Run (System.String[] args, System.Boolean setInvariantCulture) [0x00063] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.Main (System.String[] args) [0x00038] in <3be9f628f5fa469389bd6a91a579ba8a>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: Android NDK r19 or newer not detected at 'null'.
at Unity.IL2CPP.Building.ToolChains.Android.AndroidNDKUtilities..ctor (NiceIO.NPath ndkRootPath, Unity.IL2CPP.Common.Architecture architecture, System.Boolean useDependenciesToolChain) [0x00078] in :0
at Unity.IL2CPP.Building.ToolChains.AndroidToolChain..ctor (Unity.IL2CPP.Common.Architecture architecture, Unity.IL2CPP.Building.BuildConfiguration buildConfiguration, System.Boolean treatWarningsAsErrors, System.Boolean assemblyOutput, System.Boolean useDependenciesToolChain, NiceIO.NPath toolchainPath) [0x00008] in :0
at Unity.IL2CPP.Building.Platforms.AndroidPlatformSupport.MakeCppToolChain (Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x00000] in :0
at il2cpp.Compilation.CompilationDriver.Run (Unity.IL2CPP.Common.RuntimePlatform platform, Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x000c0] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.DoRun (System.String[] args, Unity.IL2CPP.Common.RuntimePlatform platform, Unity.IL2CPP.Building.BuildingOptions buildingOptions) [0x0001f] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.Run (System.String[] args, System.Boolean setInvariantCulture) [0x00063] in <3be9f628f5fa469389bd6a91a579ba8a>:0
at il2cpp.Program.Main (System.String[] args) [0x00038] in <3be9f628f5fa469389bd6a91a579ba8a>:0

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/me/Development/Project_Repo/project/project_upgrade/android/unityLibrary/build.gradle' line: 51

  • What went wrong:
    Execution failed for task ':unityLibrary:BuildIl2CppTask'.

Process 'command '/Applications/Unity/Hub/Editor/2020.1.16f1/Unity.app/Contents/MonoBleedingEdge/bin/mono'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdatedThis issue is outdated probably upgrade version resolve problem.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions