This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Android problems


Hello ;)

I've taken a bit of a hiatus, but now I'm back to playing with Kawa and
Android. I've run into a few problems...

1) Kawa seems to be compiled against 1.8, which uses
java.lang.invoke.MethodHandle a lot, which Android does not seem to
support. Is there a simple way to compile a kawa.jar against 1.6, so I
can use it for Android?

2) In the following code, I get a kawa segfault. It seems to be related
to the anonymous inner class, if I factor that out, things work fine.

(define-simple-class test (<android.app.Activity>)
          ((onCreate (savedInstanceState :: <android.os.Bundle>)):: void
           (invoke-special <android.app.Activity> (this) 'onCreate savedInstanceState)
           (let* ((self (this)))
             (let* ((adpt (object (<android.widget.ArrayAdapter>)
                                  ((*init*)
                                   (invoke-special <android.widget.ArrayAdapter> (this) '*init* self (static-field android.R$layout 'simple_list_item_1)))
                                  ((getView (position :: int) (convert-view :: android.view.View) (parent :: android.view.ViewGroup)) :: android.view.View
                                   #!null)))
                    (lv (<android.widget.ListView> self adapter: adpt)))
               (setContentView lv)))))

> make -k
CLASSPATH=kawa.jar:/opt/android-sdk/platforms/android-14/android.jar java kawa.repl -d bin/classes -P test. --module-static-run --warn-undefined-variable --warn-unknown-member --warn-invoke-unknown-method -C foo.scm
(compiling foo.scm to test.foo)
foo.scm:6: internal error while compiling foo.scm
java.lang.NullPointerException
	at gnu.bytecode.Scope.getVariable(Scope.java:105)
	at gnu.expr.ClassExp.compileMembers(ClassExp.java:537)
	at gnu.expr.LambdaExp.compileEnd(LambdaExp.java:615)
	at gnu.expr.ClassExp.compileMembers(ClassExp.java:560)
	at gnu.expr.LambdaExp.compileEnd(LambdaExp.java:615)
	at gnu.expr.Compilation.generateBytecode(Compilation.java:2077)
	at gnu.expr.Compilation.process(Compilation.java:1943)
	at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:306)
	at gnu.expr.ModuleInfo.loadByStages(ModuleInfo.java:288)
	at kawa.repl.compileFiles(repl.java:780)
	at kawa.repl.processArgs(repl.java:441)
	at kawa.repl.main(repl.java:820)
make: *** [Makefile:2: all] Error 255

Is this somehow my fault, or is this a bug in the compiler?

Thanks for any help!

Greetings, Peter


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]