electronicarts / ea-async

EA Async implements async-await methods in the JVM.
https://go.ea.com/ea-async
Other
1.38k stars 129 forks source link

Sounds like a good idea... #64

Closed neilyoung closed 1 year ago

neilyoung commented 1 year ago

...does not work.

Crashes immediately in Async.init()

2023-06-06 16:57:53.160  3727-3727  AndroidRuntime          com.example.myapp                E  FATAL EXCEPTION: main
                                                                                                    Process: com.example.myapp, PID: 3727
                                                                                                    java.lang.ExceptionInInitializerError
HaloFour commented 1 year ago

I think you need to use compile-time instrumentation in order to get it to work on Android as Davlik lacks the agent instrumentation capabilities of the full JVM?

neilyoung commented 1 year ago

Whatever this means..

neilyoung commented 1 year ago

Anyway, don't bother with this. I put it aside.

HaloFour commented 1 year ago

It means that Async.init() can't work because Android doesn't use a proper Java runtime. There are maven and gradle build plugins provided which can perform the transformations at compile-time so that it doesn't depend on a specific runtime, and should be able to run on Android.

neilyoung commented 1 year ago

Well, I'm using the gradle plugin, but maybe wrong.

implementation 'com.ea.async:ea-async:1.2.3'

then

static { Async.init(); }

There was no other condition mentioned