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]

problems with android: couldn't find static field


Hello,
I've been trying to work with kawa on android, and it seems to work very fine in certain situations, but I keep running into the following problem:

D/dalvikvm(32363): DexOpt: couldn't find static field
W/dalvikvm(32363): VFY: unable to resolve static field 9 (Lit0) in Lat/nexoid/HelloScheme;
D/dalvikvm(32363): VFY: replacing opcode 0x62 at 0x0005
D/dalvikvm(32363): VFY: dead code 0x0007-0016 in Lat/nexoid/HelloScheme;.onCreate (Landroid/os/Bundle;)V
D/AndroidRuntime(32363): Shutting down VM
W/dalvikvm(32363): threadid=1: thread exiting with uncaught exception (group=0x4001d7d0)
E/AndroidRuntime(32363): FATAL EXCEPTION: main
E/AndroidRuntime(32363): java.lang.NoSuchFieldError: at.nexoid.HelloScheme.Lit0
E/AndroidRuntime(32363): 	at at.nexoid.HelloScheme.onCreate(HelloScheme.scm:10002)
E/AndroidRuntime(32363): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(32363): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime(32363): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(32363): 	at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime(32363): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(32363): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(32363): 	at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(32363): 	at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(32363): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(32363): 	at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(32363): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
E/AndroidRuntime(32363): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
E/AndroidRuntime(32363): 	at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 3022):   Force finishing activity at.nexoid/.HelloScheme


My scheme file is:

(require 'android-defs)
(activity at.nexoid.HelloScheme
          (on-create-view
           (let ((tv (android.widget.TextView (this))))
             (tv:setText "foo"))))

The relevant part of my build.xml is:

<target name="sinstall" depends="scompile, compile, install"/>
    <target name="scompile" depends="-resource-src, -aidl, -pre-compile">
      <apply taskname="kawa" executable="java"
             failonerror="true" parallel="true">
        <arg value="-classpath"/> <arg path="${external.libs.dir}/kawa.jar:${android.jar}"/>
        <arg value="kawa.repl"/>
        <arg value="-d"/> <arg path="${out.classes.dir}"/>
        <arg line="-P ${manifest.package}. --module-static-run --warn-undefined-variable --warn-invoke-unknown-method"/>
        <arg value="-C"/>
        <fileset dir=".">
          <include name="**/*.scm"/>
        </fileset>
      </apply>
    </target>


javap -c of the class file shows:
Compiled from "HelloScheme.scm"
public class at.nexoid.HelloScheme extends android.app.Activity{
public void onCreate(android.os.Bundle);
  Code:
   0:	aload_0
   1:	aload_1
   2:	invokespecial	#6; //Method android/app/Activity.onCreate:(Landroid/os/Bundle;)V
   5:	getstatic	#12; //Field gnu/kawa/reflect/Invoke.invoke:Lgnu/kawa/reflect/Invoke;
   8:	aload_0
   9:	getstatic	#18; //Field Lit0:Lgnu/mapping/SimpleSymbol;
   12:	new	#20; //class android/widget/TextView
   15:	dup
   16:	aload_0
   17:	invokespecial	#24; //Method android/widget/TextView."<init>":(Landroid/content/Context;)V
   20:	astore_2
   21:	aload_2
   22:	ldc	#26; //String foo
   24:	invokevirtual	#30; //Method android/widget/TextView.setText:(Ljava/lang/CharSequence;)V
   27:	getstatic	#36; //Field gnu/mapping/Values.empty:Lgnu/mapping/Values;
   30:	invokevirtual	#42; //Method gnu/mapping/Procedure.apply3:(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
   33:	pop
   34:	return

public at.nexoid.HelloScheme();
  Code:
   0:	aload_0
   1:	invokespecial	#45; //Method android/app/Activity."<init>":()V
   4:	return

}

It seems that the gnu.mapping.SimpleSymbol field is not found.. is this a problem with the dalvik VM or am I somehow compiling things incorrectly?

Any help would be appreciated!

Peter

Attachment: pgp00000.pgp
Description: PGP signature


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