It’s supposed to look like this: https://www.dropbox.com/s/guv1edpvqxiwq0x/Screenshot%202015-01-14%2018.06.10.png?dl=0
If the the latest official 4.6.1 counts as mono, no it does not happen. If you mean that I should try compiling it again using Mono instead of IL2CPP using 4.6.1p3 then I have to try that…
bbl
I believe we traced down cause of this issue. We are putting all generated code into “__managed” code segment section and that makes Xcode lost when debugging. You could try disabling it in Xcode project by modifying Libraries/libil2cpp/include/il2cpp-config.h and replacing there:
#define IL2CPP_METHOD_ATTR __attribute__((section ("__TEXT,__managed")))
with
#define IL2CPP_METHOD_ATTR
Note: this will break reporting of managed exception stacktraces
IL2CPP: Unexpected types used with Div_Un opcode. Types are Int32 and Int32
Bug report with sample project
http://fogbugz.unity3d.com/default.asp?662886_oor2q3klpvtjri99
Looks like it isn’t there. Are you sure you installed and opened Unity that was downloaded from the link posted in this thread?
I’m just gonna take a wild guess here but I think my app choked on this function which deep copies/clones any object (marked as [System.Serializable]) by serialising it and then unserialising it… hm… it worked until now
public static T Clone<T>(this T source) { // In case you prefer to use the new extension methods of C# 3.0, change the method to have the following signature:
//public static T Clone<T>(T source) {
if (!typeof(T).IsSerializable) {
throw new ArgumentException("The type must be serializable.", "source");
}
// Don't serialize a null object, simply return the default for that object
if (object.ReferenceEquals(source, null)) { // JGHG: changed Object into object
return default(T);
}
#if UNITY_IOS
ObjectCopier.SetEnvironmentVariables(); // JGHG added
#endif
IFormatter formatter = new BinaryFormatter();
Stream stream = new MemoryStream();
using (stream) {
formatter.Serialize(stream, source);
stream.Seek(0, SeekOrigin.Begin);
return (T)formatter.Deserialize(stream);
}
}
/*SetEnvironmentVariablesrequiredtoavoidrun-timecodegenerationthatwillbreakiOScompatibility
* SuggestedbyNicodePoel:
* http://answers.unity3d.com/questions/30930/why-did-my-binaryserialzer-stop-working.html?sort=oldest
*/
privatestaticvoidSetEnvironmentVariables() {
//http://answers.unity3d.com/questions/30930/why-did-my-binaryserialzer-stop-working.html?sort=oldest
Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");
}
I was able to make my app avoid the problem by writing a manual copy constructorish function on the class that I was copying.
Then I found another problem a few seconds later:
SerializationException: Could not find type 'System.Collections.Generic.EqualityComparer`1+DefaultComparer[[POKERHAND_RATING, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'.
at VivideEngine.checkandreportachievementsatendofstage () [0x00000] in <filename unknown>:0
POKERHAND_RATING is just an enum like this:
publicenumPOKERHAND_RATING {
INVALID = 0,
HIGHCARD, //1
ONEPAIR,
TWOPAIR,
THREEOFAKIND,
STRAIGHT, //5
FLUSH,
FULLHOUSE,
FOUROFAKIND,
STRAIGHTFLUSH,
ROYALSTRAIGHTFLUSH//10
}
Hmm this forum interface kills most of my spaces…
Thanks, this does seem to fix the debugger. It’s good enough as a workaround for now.
Thanks for tracking this down. We actually have a bug that we are actively investigating for this same issue (case 662564). For the time being, it is best to disable stripping iOS player options. Note that for IL2CPP, we are always doing byte code stripping of the IL code before the IL → C++ conversion (even if the stripping setting is disabled). So you should still see the benefits of stripping.
Of course, IL2CPP is generating binaries that are larger than Mono AOT, but we are also working actively to improve the binary size.
@e-kornyushenko Thanks for reporting this bug. It has actually already been corrected internally already. I’ve just verified that the project you submitted with the bug builds correctly using the code for the next 4.6 beta release.
@Umai this most recent error looks similar one you reported a bit earlier. Have you been able to try the suggestion @Lucas-Meijer made in this case as well?
Defining a field like this:
public System.Collections.Generic.EqualityComparer<POKERHAND_RATING> _unused = new System.Collections.Generic.EqualityComparer<POKERHAND_RATING>();
should cause the IL2CPP AOT compiler to generate C++ code for the EqualityComparer<POKERHAND_RATING> type, which I believe will work around the problem. If it does not allow things to work, please submit a bug with a project that reproduces this issue (if possible).
We’re working to improve the ability of IL2CPP to construct generic types at runtime, but at the moment we need to do some work arounds like this.
A simple co-routine does not work for me when using IL2CPP.
void Start()
{
StartCoroutine(Play());
}
IEnumerator Play()
{
Debug.Log(“Co-routine plays”);
yield break;
}
The generated cpp code skips the Debug.Log line. Filed as bug Case 663197.
I’ve submitted this same bug (case 663004.) IL2CPP generates incorrect code for the coroutine when the only yield it contains is ‘yield break’. If you add other kinds of yields into it, then it will work.
Ok it shows up now. I had downloaded the 4.6.1p3 patch twice but it finally worked when I downloaded it from the link in this thread. Is there a chance that the patch on this page isn’t the same as the one in the link in this thread?
Yes, this forum contains link to custom build with iOS 64 bit support. We aim to land to regular patch-release next week. Fingers crossed…
I ran a 1st quick test of my game last night with IL2CPP. Got lots of warnings (most of them already mentioned in this thread), the estimated app size in the store went from 100 to 132MB as expected, and it seemed to run OK for the most part. Here are 3 things I noticed though:
-
in the console window of XCode, I saw some messages such as:
Unable to find type UnityEngine.ResourceRequest
Unable to find type UnityEngine.SocialPlatforms.GameCenter.GameCenterPlatform
Not sure what this is about and probably harmless, this project definitely doesn’t use the GameCenter stuff (I have a plugin for that) -
I got the impression the game was lagging from time to time, like some frames were skipped, similar to what you would get with long garbage collections. I don’t think I’ve ever seen those in the Mono version built with 4.6.1f1, but I’ll have to play both versions more, and maybe profile them, to be 100% sure.
-
I got a 100% crash that should be easy to fix, trying to marshal a null string when calling a plugin. Case 663353
Thanks for the information @Frederic-My .
-
We’re actively looking at the issues with GameCenterPlatform, etc. It seems that something is being incorrectly stripped from UnityEngine.dll.
-
If you can scope done the lag to something that we can investigate, we would certainly like to sort it out.
-
We have an internal fix for case 663353. It may not make the next 4.6 iOS/IL2CPP release, but it will be coming out soon.
Hey,
Thanks for the reports. I’ve reproduced and fixed the “coroutine with only a yield break” bugs (66319 &
663004).
The “GameCenter” doesn’t work bug has been found, cause been found, and I’m working on a fix.
I haven’t checked lately, but the unity profiler should work with il2cpp builds, so there’s a good chance you can use it to identify the spikes you’re seeing, and see if they are gc related, or something else. You could also use apple’s instruments. If it is gc, you’ll see a lot of symbols on the stack that start with GC_mark (GC_mark_some especially).
If you’re having a hard time figuring out what is causing the spikes, and it is reproducable, we would love to get a bugreport on it.
Thanks for all the bugreports, please keep 'm coming, we’re knocking them all down as fast as we can.
Lucas
2 quick questions:
-
to test the 64 bit part of the build, I only need to run it on an iPhone 5S/6/6+, right? Nothing else I need to do? So far I’ve only tried my project on a 32 bit iPad.
-
I wanted to double check the versions of some libraries I use (for example: Flurry) support 64 bits. In a terminal window, when I do:
file libFlurry_5.4.0.a
I don’t see arm64 listed. However, if 64 bits wasn’t supported, I would get link errors when XCode compiles the Unity project, wouldn’t I?
Actually, there is one plugin I wrote myself and haven’t recompiled yet, and I’m not getting link errors; how come?
Hi Jonas,
Regarding my test, there problem with Social.localUser.Authenticate API that causing crash on iOS.
Here the bug report I filled yesterday and hope this help.
http://fogbugz.unity3d.com/default.asp?663134_392890a8uocu6d5k
Thanks
Ok after removing and reinstalling each (Updated) component one by one… I have a working IL2CPP build. When I run the app on my test device I get the following error:
Initialize engine version: 4.6.1p3 (f86f15b5d5ee)
Unable to find type [UnityEngine.dll]UnityEngine.ResourceRequest
…and following can’t find other important DLLs
I can confirm Prime31’s components are all working with the exception of Android Combo, the IOS interfaces have not yet been updated.