Fatal error: MSpanList_Insert - Can't install android codeworks under OSX

I receive this error everytime I try and install, help please.

same here

Hi johnbo,

We’ll need some more information to help troubleshoot this issue:

  1. Please cut and paste this info in a text doc and post instead of a screenshot so we can review the doc and search for key terms.
  2. Were you able to install Codeworks with a previous version of the Engine and was it functional?

Please respond with this information.

Thanks,

.

I’m not johnbo but got the same issue

  1. ok - it won’t let me attach a text doc, so here it is pasted
  2. On my side I’m not sure, but I managed ot publish something, so I suppose so.

Thanks

ERROR
Installing Android SDK Base 24.4.1_u1 failed.

Return Code: 2
failed MSpanList_Insert 0x2ca2c0 0x5022dd0c0276 0x0
fatal error: MSpanList_Insert

goroutine 16 [running]:
runtime.throw(0x26a8bb)
/home/amyl/software/go/src/pkg/runtime/panic.c:520 +0x69 fp=0x467978 sp=0x467960
runtime.MSpanList_Insert(0x27ec48, 0x2ca2c0)
/home/amyl/software/go/src/pkg/runtime/mheap.c:618 +0x8a fp=0x4679a0 sp=0x467978
MHeap_FreeLocked(0x27de40, 0x2ca2c0)
/home/amyl/software/go/src/pkg/runtime/mheap.c:445 +0x187 fp=0x4679e0 sp=0x4679a0

Hey tasook,

This is not related to UE4 but rather an issue regarding Nvidia’s installer on Apple’s OS. New Codework from Nvidia is currently in testing however I cannot provide an accurate estimation for when this will be resolved.

-.

I have the same exact error and stack trace displayed.

You can download 1R5 from NVIDIA’s Download Center

Android CodeWorks 1R5 doesn’t work on macOS | Sadly.
You can use homebrew to solve a part of the problems.

Homebrew install
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
brew install android-sdk android-ndk ant

export ANDROIDSDK_HOME=/usr/local/opt/android-sdk
export ANDROIDNDK_HOME=/usr/local/opt/android-ndk

So, the problem seems to be from not have Java 6 and 7 installed. If you do not wish to use NVIDIA’s toolchain installer, you don’t have to, instructions follow for macOS…

  • Remove everything you installed with Homebrew
  • Download the Android SDK for macOS
  • Download the Android NDK for macOS
  • Download Apache Ant
  • Make sure you have a JDK installed (Preferably Oracles), 1.7 or 1.8 will both work
  • Execute echo $(/usr/libexec/java_home) in bash, and copy the output
  • Set JAVA_HOME to the path bash showed you, and you have copied in the clipboard
  • Set ANDROID_HOME to the where you extracted the SDK
  • Set NDKROOT to where you extracted the NDK
  • Set ANT_HOME to where you extract Apache Ant
  • Go into the editor and setup the same paths as above in the Project Settings > Android
  • Build something awesome

The current Wiki can be misleading according to common practices in macOS installing things.

First, UE expects ant and friends to all be in certain paths from ANT_HOME, which does not work with Homebrew. Homebrew installs the binary in /usr/local/bin, but the other files that UE needs are in the cellar folder. UE can’t cope with that.

The second pitfall is how java_home is handled in macOS. It is commonly set in .profile as export JAVA_HOME=$(/usr/libexec/java_home), which is fine when bash is your shell executing that, but UE wraps in mono for the build system, so it takes it as a string literal and poops out during build time.

Third, it is sometimes common to set environment variables in .profile, which will not work. You need to set them all in .bash_profile instead.

As long as you use the Android SDK manager and download all of the API SDK and tooling, when you build, you will be fine.

Left a more detailed response to help you out, below.

I used the same files downloaded by codeworks, for example, ndk (~/.NVIDIA/CodeWorksforAndroid/00X/android-ndk-r12b-darwin-x86_64.zip). So I didn’t have to download it all again. BTW, after change bash_profile and export vars, I don’t have to edit Prj Set > Android. Just leave it blank.

If anyone is still having trouble with this, I have made a very straight forward guide: Physica Games - Unreal Engine V4.14 Cannot Deploy to Android

It is worth a try first, before attempting what other posters in this topic have suggested, as it is very straight forward. Hope it helps

@nathansizemore can you please tell me how to set ANDROID_HOME, JAVA_HOME, NDKROOT, ANT_HOME

Are these environment variables? I can find how to set JAVA_HOME & ANDRIOD_HOME on google search but not NDKROOT & ANT_HOME. Can you help me with that?

Also @nathansizemore I have zsh-shell installed…so do I still have to add those exports to .bash_profile? Or I can add them to .zshrc?

@AbhimanyuAryan Yes, those are environment variables. Yes, you’ll still want them as export in ~/.bash_profile

@AbhimanyuAryan UE might use your default shell, which would be zsh-shell if you changed it from being bash by default. I’m not sure on this because I only use bash.

natan can you please check my question here RunUAT ERROR: AutomationTool was unable to run successfully - Mobile - Unreal Engine Forums

and help me out fix this issue?

I got this exact error, and I managed to get this working. It just so happened that I hadn’t installed java and/or codeworks correctly. I have already linked it, but follow this first: