D on android and d_android

Adam D. Ruppe destructionator at gmail.com
Tue Apr 7 12:29:57 UTC 2020


On Tuesday, 7 April 2020 at 11:45:24 UTC, burt wrote:
> I managed to get it to compile. I had to add __bss_end__ symbol 
> myself and set the value to the value of the `_end` symbol or 
> it wouldn't work. A PR to the LDC druntime is wat caused the 
> __bss_end__ symbol to be missing [0].

Blargh it was supposed to just work without main() on the new ldc 
but I only actually ran stuff with 1.19 on actual android.


> However, when I added a MainActivity class in D using arsd.jni, 
> the app crashes whenever one of the @Exported methods is called.

What does the android studio debugger say about it? Missing 
method or another link problem?

> And a callback method for a button in Java called dFunction 
> with the appropriate parameters. I noticed that the generated 
> .so file didn't contain a 
> `Java_com_mypackage_myapplication_MainActivity_dFunction` 
> symbol. Any help on this would be appreciated.

Yeah, it uses a private name and registers that in a static 
module constructor (this allows it to support overloads more 
easily), so that specific name not being there isn't wrong, but 
it could be the registration function never got called again.


sorry I've been so unresponsive on all this, I've had a lot other 
surprise/emergency stuff going on irl so I'm barely keeping up 
with my email.


More information about the Digitalmars-d-learn mailing list