- Home /
Threading is somehow included in my Flash Build, how to I track down what's using it?
I'm making a flash build of a tiny game. When I started porting it, there were a ton of issues being thrown by the build step FlashDotNetAPIValidationRule (things like System.TextBuilder.AppendLine is not supported). These were easy enough to port, but now I'm down to my last error:
Usage of a type or method not supported by Unity Flash.
* Details: Invokes an unsupported method System.Int32 System.Threading.Interlocked::CompareExchange(System.Int32&,System.Int32,System.Int32) on type System.Threading.Interlocked
* Source: debugging symbols unavailable, IL offset 0x0009 at line : 0
I've searched around my project for anything obvious that would be using threads and then I just started commenting out systems that could even conceivably touch threads, but I haven't figured out what's using threads. Does anyone have any advice for tracing code dependencies so that I can debug this sort of problem?
The only thing I can think of at this point is the "debugging symbols unavailable" part. Does anyone know of a way to make the engine aware of the symbols so that I could get a filename and linenumber or any other info that might help?
Nope. I discontinued this project when Unity discontinued their Flash build. I never figured it out... good luck
Answer by RalphH · Jul 10, 2013 at 02:06 PM
If all your assemblies are compiled by Unity, then setting "development build" checkbox in the build menu will allow you to track these down.
Answer by frevd · Mar 24, 2014 at 02:34 AM
This issue is caused with yields in for loops:
public IEnumerable<Moo> Moos
{
get
{
foreach (Moo moo in moos)
yield return moo; // ERROR
}
}
To solve it, do not return the enumerated object.
public IEnumerable<Moo> Moos
{
get
{
#if UNITY_FLASH
List<Moo> res = new List<Moo>();
foreach (Moo moo in moos)
res.Add(moo);
return res; // somewhat defeats the purpose, but wth
#else
foreach (Moo moo in moos)
yield return moo; // ERROR
#endif
}
}
Enjoy, frevd
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Unity3d 3.5 Build to flash error dump debug 0 Answers
Flash build does nothing at all 1 Answer
Build for Flash 10.1 Player 1 Answer
Flash Build Problem 0 Answers