public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Building for Android
@ 2022-10-18 14:57 Panicz Maciej Godek
  2022-10-18 15:25 ` Per Bothner
  0 siblings, 1 reply; 22+ messages in thread
From: Panicz Maciej Godek @ 2022-10-18 14:57 UTC (permalink / raw)
  To: kawa

[-- 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)

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-10-24 12:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18 14:57 Building for Android Panicz Maciej Godek
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

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).