public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* "Uncaught translation error" when transforming Kawa-compiled classes with dex
@ 2017-08-29 17:10 Kay Zheng
  2017-08-29 17:13 ` Sonny To
  2017-08-29 18:02 ` Per Bothner
  0 siblings, 2 replies; 8+ messages in thread
From: Kay Zheng @ 2017-08-29 17:10 UTC (permalink / raw)
  To: Per Bothner, Kawa mailing list

Hi Per,

I tried building a simple skeleton Android app against the master
branch, targeting Android API level 21 (Android 5.0). The compilation
went well, but there's this ambiguous error when classes are being
transformed to dex files:

    Uncaught translation error: com.android.dx.cf.code.SimException:
local variable type mismatch: attempt to set or access a value of type
int using a local variable of type gnu.mapping.CallContext. This is
symptomatic of .class transformation tools that ignore local variable
information.

I don't really understand this error message, but since
gnu.mapping.CallContext is part of Kawa, I'd try and post it in this
mailing list.

The source code for the skeleton app is on
https://github.com/l04m33/KawaAndroidTemplate

And here's how I built Kawa (I didn't install JDK 6, and used OpenJDK
8 instead, thus the explicit JAVACFLAGS):

    $ cat rebuild-kawa-latest-android.sh
    #!/bin/sh

    cd ./Kawa-latest-android

    if [ -f 'Makefile' ]; then
        make clean
        make distclean
    fi

    git checkout -- .
    git apply ../kawa-javacflags.patch

    ./autogen.sh
    export JAVACFLAGS="-g -source 1.6 -target 1.6"
    ./configure
--with-android=/home/user/android_sdk/platforms/android-21/android.jar
\
                --disable-xquery \
                --disable-jemacs \
                --with-java-source=6
    make

And the content of kawa-javacflags.patch:

    $ cat kawa-javacflags.patch
    diff --git a/Makefile.am b/Makefile.am
    index da9e490..a0df1a3 100644
    --- a/Makefile.am
    +++ b/Makefile.am
    @@ -372,10 +372,10 @@ $(srcdir)/patch-source-list: $(top_srcdir)/configure
          | sed -e 's|./||' | sort > $@

     kawa/Version.class: kawa/Version.java
    -   $(JAVAC) -d . $^
    +   $(JAVAC) -d . $(JAVACFLAGS) $^

     gnu/kawa/util/PreProcess.class: gnu/kawa/util/PreProcess.java
    -   $(JAVAC) -d . $^
    +   $(JAVAC) -d . $(JAVACFLAGS) $^

     JAVA_PREPROCESS_OPTIONS = @JAVA_SOURCE_SELECTOR@
$(PREPROCESS_HTTPSERVER) $(PREPROCESS_XML) $(PREPROCESS_JLINE3)
$(PREPROCESS_AWT)

P.S.: I think this is an separate issue with hairy details, so I made
a new thread.

Regards,
Kay Z.

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

end of thread, other threads:[~2017-08-30  5:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 17:10 "Uncaught translation error" when transforming Kawa-compiled classes with dex Kay Zheng
2017-08-29 17:13 ` Sonny To
2017-08-29 17:31   ` Kay Zheng
2017-08-29 18:02 ` Per Bothner
2017-08-29 20:13   ` Kay Zheng
2017-08-29 20:31     ` Per Bothner
2017-08-30  0:39       ` Per Bothner
     [not found]         ` <CAJCc8OyZ-D4=zB-u6=V108F+=_ZauWw56L2ZzZBvVy8u67qVaQ@mail.gmail.com>
2017-08-30  5:34           ` Kay Zheng

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