public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: kawa@sourceware.org
Subject: Building for Android
Date: Tue, 18 Oct 2022 16:57:15 +0200	[thread overview]
Message-ID: <CAMFYt2a2uJQGyDQ3a_6d_KxFd=k4CHh_q5SQoY5yyCW=ztJJQg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2641 bytes --]

Hi,
I've been trying to build a stub for GRASP running in the Android
environment.

My earlier prototype was written in Java, based on the scripts from a
github project called 'buildAPKs', that lets one build Android projects on
Android (using the Termux app).

Also, I found a github project that showd how to build apps written in Kawa
for Android, and even managed to build and run an example application:

https://github.com/abarbu/android-kawa

However, the caveat is that it comes with a kawa.jar file with version
1.13, which is quite old (and there are many features from the more recent
Kawa releases that GRASP relies on).

But when I try to build the KawaHello example using a kawa.jar built from
the most recent version, I get an error from the Android's ''dexer" tool
(which translates JVM bytecode to Dalvik/ART):

PARSE ERROR:
 unsupported class file version 61.0
...while parsing gnu/bytecode/Access.class

So, what I suppose happens, is that the javac which builds Kawa emits byte
code that is unsupported by dx.

I tried building Kawa having passed --with-java-source=7 to the 'configure'
script, but that didn't help. I also tried cosplaying javac by ecj (which
is the compiler that the buildAPKs uses), but this results with a bunch of
warnings and some errors:

180. WARNING in
/data/data/com.termux/files/home/Kawa2/gnu/kawa/util/AbstractHashTable.java
(at line 243)                                                     static
class AbstractEntrySet<Entry extends Map.Entry<K,V>, K, V> extends
AbstractSet<Entry>
                              ^^^^^                                The type
parameter Entry is hiding the type Map.Entry<K,V>
 ----------
181. ERROR in
/data/data/com.termux/files/home/Kawa2/gnu/kawa/util/AbstractHashTable.java
(at line 287)
 nextEntry = htable.table[nextIndex];
             ^^^^^^^^^^^^^^^^^^^^^^^                                Type
mismatch: cannot convert from Map.Entry to Entry
----------
182. ERROR in
/data/data/com.termux/files/home/Kawa2/gnu/kawa/util/AbstractHashTable.java
(at line 298)
 nextEntry = htable.getEntryNext(currentEntry);
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                      Type
mismatch: cannot convert from Map.Entry to Entry
----------


I'm not really sure where these errors stem from - I suppose ecj supports a
different subset of Java than the one that was used to write Kawa (I was
forcing source and tarfet

I also tried aliasing javac as javac -release 7, but it still seens to
produce the class file version 61.0.

Does anyone know how to produce a kawa.jar that would satisfy the dexer?
(The dexer version from the termux repo is 1.16)

             reply	other threads:[~2022-10-18 14:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 14:57 Panicz Maciej Godek [this message]
2022-10-18 15:25 ` Per Bothner
2022-10-18 18:25   ` Panicz Maciej Godek
2022-10-19  9:15     ` Panicz Maciej Godek
2022-10-19 16:05       ` Per Bothner
2022-10-19 17:09         ` Panicz Maciej Godek
2022-10-20  5:35           ` Panicz Maciej Godek
2022-10-20 20:48             ` Panicz Maciej Godek
2022-10-21  5:14               ` Panicz Maciej Godek
2022-10-21 13:59                 ` Panicz Maciej Godek
2022-10-21 18:11                   ` Per Bothner
2022-10-21 19:19                     ` Panicz Maciej Godek
2022-10-21 19:31                       ` Per Bothner
2022-10-21 19:45                         ` Panicz Maciej Godek
2022-10-21 20:13                           ` Panicz Maciej Godek
2022-10-22  6:26                           ` Per Bothner
2022-10-22  9:31                             ` Panicz Maciej Godek
2022-10-22 12:08                               ` Panicz Maciej Godek
2022-10-24  7:22                                 ` Panicz Maciej Godek
2022-10-24 10:48                                   ` Per Bothner
2022-10-24 12:01                                     ` Panicz Maciej Godek
2022-10-21 18:00           ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMFYt2a2uJQGyDQ3a_6d_KxFd=k4CHh_q5SQoY5yyCW=ztJJQg@mail.gmail.com' \
    --to=godek.maciek@gmail.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).