DynamicExpresso icon indicating copy to clipboard operation
DynamicExpresso copied to clipboard

No ahead of time (AOT) code was generated. ( IL2CPP scripting backend)

Open Vah94 opened this issue 3 years ago • 10 comments

Hi guys. Cant run an example on the Android platform after update 2.9.8 (Unity 2020.3.25f1 (64-bit))

ExecutionEngineException: Attempting to call method 'System.Linq.Expressions.Interpreter.LightLambda::MakeRun1<System.Int32,System.Boolean>' for which no ahead of time (AOT) code was generated.

Vah94 avatar Dec 23 '21 14:12 Vah94

Do you get this error just for a particular expression? Or for all? Can you provide some way to reproduce the problem locally?

davideicardi avatar Dec 23 '21 17:12 davideicardi

Hi @davideicardi, an error was acquired for all examples. Is there any way, settings I need to change for the Android build?

Vah94 avatar Dec 23 '21 21:12 Vah94

@Vah94 Sorry, I'm not expert at all on Android platform. I assume that you use it inside Unity. Correct? Which version?

Can you provide us a way to reproduce the problem in a linux or win machine? Otherwise for us can be difficult to fix the issue.

davideicardi avatar Dec 23 '21 22:12 davideicardi

@Vah94 you said it stopped working after the migration to 2.9.8, did it work with a previous version of DynamicExpresso? If you could find the last version where it worked, it would help us find what could cause the issue.

metoule avatar Dec 24 '21 08:12 metoule

The problem can be reproduced by building with an IL2CPP scripting backend. image

Vah94 avatar Dec 24 '21 08:12 Vah94

Hi @metoule, previous version is 2.9.3

Vah94 avatar Dec 24 '21 08:12 Vah94

Hi @Vah94, happy new year! Just to confirm, it worked with 2.9.3, but failed with 2.9.4?

metoule avatar Jan 03 '22 10:01 metoule

TestProject(2D).zip Hi @metoule :D Could you check the attached project?

Vah94 avatar Feb 09 '22 10:02 Vah94

Not sure if people are still interested in this topic. I just ran into the same problem. And I found the reason why it happened but could not find any solution. Tried linker.xml as recommended by documentation, it did not work (might be me doing it wrong).

Here is why: When building with IL2CPP in Unity, some code will be automatically stripped if the engine does not find any usage of the code in your project. If you change to Mono which does not strip any code, it should probably work as fine.

wangjingtiankl avatar Dec 05 '22 09:12 wangjingtiankl

I can try to help, but as you can immagine it can be difficult to understand for us.

Here are the changes between 2.9.3 and 2.9.4: https://github.com/dynamicexpresso/DynamicExpresso/compare/v2.9.3...v2.9.4

@Vah94 Can you confirm that these are the versions affected?

davideicardi avatar Dec 14 '22 22:12 davideicardi