-
Notifications
You must be signed in to change notification settings - Fork 230
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
il2cpp not compiling #258
Comments
What is il2cpp? Will needs lots more information to help with this. |
Here is demo project attached: You put ironpython into Unity2017, it works seamlessly with mono runtime. |
Failed running /Applications/Unity/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll --convert-to-cpp --emit-null-checks --enable-array-bounds-check --map-file-parser="/Applications/Unity/Unity.app/Contents/Tools/MapFileParser/MapFileParser" --assembly="/Users/sekkit/Documents/pytest/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" --assembly="/Users/sekkit/Documents/pytest/Temp/StagingArea/Data/Managed/UnityEngine.dll" --assembly="/Users/sekkit/Documents/pytest/Temp/StagingArea/Data/Managed/IronPython.Modules.dll" --assembly="/Users/sekkit/Documents/pytest/Temp/StagingArea/Data/Managed/IronPython.dll" --assembly="/Users/sekkit/Documents/pytest/Temp/StagingArea/Data/Managed/Microsoft.Scripting.Core.dll" --assembly="/Users/sekkit/Documents/pytest/Temp/StagingArea/Data/Managed/Microsoft.Scripting.dll" --assembly="/Users/sekkit/Documents/pytest/Temp/StagingArea/Data/Managed/System.dll" --assembly="/Users/sekkit/Documents/pytest/Temp/StagingArea/Data/Managed/mscorlib.dll" --generatedcppdir="/Users/sekkit/Documents/pytest/Temp/il2cppOutput/il2cppOutput" stdout: Unhandled Exception: System.InvalidOperationException: Default value for field step must be null. UnityEngine.Debug:LogError(Object) |
This is currently outside the area of what we support. It could be something we look into in the future, but for now, this is unsupported. PR's are welcome. |
It looks like it failing on the range definition: public static List range(CodeContext/*!*/ context, object start, object stop, [DefaultParameterValue(1)]object step) It doesn't like having a Assuming this is the only failure point the fix is simply adding an overload. |
Or change it to this and see if it works: public static List range(CodeContext/*!*/ context, object start, object stop, [DefaultParameterValue((object)1)]object step) |
ok, if it works I'll update this issue. |
BTW, how can I build for 3.5 mono? I previously retrieved .net3.5 builds from NuGet. |
4.0 is the minimum framework supported. |
(object)xx ain't work. Why not change it to List range(CodeContext/!/ context, object start, object stop, [DefaultParameterValue((1))]int step)? // object to int, or int step=1 |
Because int isn't the only type that can be accepted. If you look inside the method, it accepts anything that can convert to BigInteger (which is a few different types). Do you get the same error, or a different one? |
Try these instead: /// <summary>
/// object overload of range - attempts to convert via __int__, and __trunc__ if arg is
/// an OldInstance
/// </summary>
[return: SequenceTypeInfo(typeof(int))]
public static List range(CodeContext/*!*/ context, object start, object stop) {
BigInteger stopInt = GetRangeInt(context, stop, "end");
BigInteger startInt = GetRangeInt(context, start, "start");
return range(startInt, stopInt);
}
/// <summary>
/// object overload of range - attempts to convert via __int__, and __trunc__ if arg is
/// an OldInstance
/// </summary>
[return: SequenceTypeInfo(typeof(int))]
public static List range(CodeContext/*!*/ context, object start, object stop, object step) {
BigInteger stopInt = GetRangeInt(context, stop, "end");
BigInteger startInt = GetRangeInt(context, start, "start");
BigInteger stepInt = GetRangeInt(context, step, "step");
return range(startInt, stopInt, stepInt);
} |
Yes, it worked. But there are many other DefaultValueParameter() to delete. PS: When written as "object step=1)", Visual Studio throws the same error as that in Unity. So there shall be another way of doing this. This is might be ugly but the error is gone.
Updated: https://docs.unity3d.com/Manual/ScriptingRestrictions.html#AOT Update2: |
I'm afraid the replacement you proposed for I'm not sure about the issue you're having. It sounds as if the AOT compiler is skipping over some necessary code? I don't have any specific suggestions to offer, but looking at the restrictions it sounds like you may run into quite a few issues... I don't think we have references to System.Windows.Forms.dll outside of testing code. If we do then they should probably be removed... |
thx, I'll try see if there is a chance porting it to iOS. |
If il2cpp doesn't support default paramater values, then you are not going to have much success. They are used all over the place. |
it seems only object params need to be treated. |
Hi, I have another error in Unity2017.3 and il2cpp, compiling works,but get runtime error in ios: 2018-01-22 15:11:40.497163+0800 ProductName[12971:4525475] NSURLConnection finished with error - code -1009 |
It sounds like il2cpp is stripping (or not generating) the default constructor? Try turning off bytecode stripping in the IronPython/DLR assemblies? https://docs.unity3d.com/Manual/IL2CPP-BytecodeStripping.html |
This is really not something we have the bandwidth to support right now. If you would like to submit PR's for support for this, we can review them and merge them if they are ok, but otherwise, we really can't focus on this at all. |
Hi, sorry to bother you, but il2cpp doesn't support System.Reflection.Emit(in LightLambda.MakeRunDelegateCtor),is there anyway I can avoid this? |
1 similar comment
Hi, sorry to bother you, but il2cpp doesn't support System.Reflection.Emit(in LightLambda.MakeRunDelegateCtor),is there anyway I can avoid this? |
You can try telling il2cpp to ignore that assembly.
|
IL2CPP error for method 'IronPython.Runtime.List IronPython.Modules.Builtin::range(IronPython.Runtime.CodeContext,System.Object,System.Object,System.Object)' in assembly '/Users/sekkit/Documents/lacg/trunk/client/Temp/StagingArea/Data/Managed/Newtonsoft.Json.dll'
Additional information: Build a development build for more information. Default value for field step must be null.
The text was updated successfully, but these errors were encountered: