damonkohler / sl4a

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.
Apache License 2.0
2.42k stars 804 forks source link

Script as APK project not compiling #206

Open damonkohler opened 9 years ago

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

What device(s) are you experiencing the problem on?

What firmware version are you running on the device?

What steps will reproduce the problem?
1. Follow tutorial 
http://code.google.com/p/android-scripting/wiki/SharingScripts#Scripts_as_APKs
2. The project built just fine in Eclipse (with no errors) and then
installation was done with:
./adb -s emulator-5554 install /Users/s7ephen/Documents/workspace/
ScriptForAndroidTemplate/bin/ScriptForAndroidTemplate.apk
1268 KB/s (166837 bytes in 0.128s)
       pkg: /data/local/tmp/ScriptForAndroidTemplate.apk
Success
3. Built it using Eclipse on OSX for a number of target releases (1.5,
2.0.1, and 2.1-update)
4. Launch on both a 2.1-update Motorola Milestone hardware phone and in a
2.1-update1 emulator.
5. See exception: "The application Dummy
Script (process com.dummy.fooforandroid) has stopped unexpectantly.
Please Try Again."

I am really confused with what might be going wrong here. I have been
a huge fan of ASE/SL4A for quite some time, but am finding recently
that I would like to distribute some of my tools to people beyond my
"nerdly" circle of friends ;-) As such, I would like to have a
portable apk bundle that people can easily install. I would really
appreciate any tips or insights that anyone could offer me to help me
get this working. I have included the logcat output for installation
and execution/exception of the ScriptForAndroidTemplate.

What is the expected output? What do you see instead?
No exception.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by damonkoh...@gmail.com on 19 Sep 2010 at 6:09

Copied from original issue: damonkohler/android-scripting#438

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

I also get this error, logcat (name refactored from default, everything else is 
default python script):

D/AndroidRuntime(  476): 
D/AndroidRuntime(  476): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime(  476): CheckJNI is ON
D/AndroidRuntime(  476): --- registering native functions ---
D/ddm-heap(  476): Got feature list request
I/ActivityManager(   64): Starting activity: Intent { 
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 
flg=0x10000000 cmp=com.mudsmagicalsoftware.mudvoicer/.ScriptActivity }
D/AndroidRuntime(  476): Shutting down VM
D/dalvikvm(  476): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm(  476): DestroyJavaVM shutting VM down
D/dalvikvm(  476): HeapWorker thread shutting down
D/dalvikvm(  476): HeapWorker thread has shut down
D/jdwp    (  476): JDWP shutting down net...
I/dalvikvm(  476): Debugger has detached; object registry had 1 entries
D/dalvikvm(  476): VM cleaning up
E/AndroidRuntime(  476): ERROR: thread attach failed
I/ActivityManager(   64): Start proc com.mudsmagicalsoftware.mudvoicer for 
activity com.mudsmagicalsoftware.mudvoicer/.ScriptActivity: pid=482 uid=10028 
gids={3003, 1015}
D/dalvikvm(  476): LinearAlloc 0x0 used 639500 of 5242880 (12%)
D/ddm-heap(  482): Got feature list request
I/global  (  482): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
I/global  (  482): Default buffer size used in BufferedReader constructor. It 
would be better to be explicit if an 8k-char buffer is required.
V/sl4a.InterpreterConfiguration$InterpreterListener:127(  482): Interpreter 
discovered: com.googlecode.pythonforandroid
V/sl4a.InterpreterConfiguration$InterpreterListener:127(  482): Binary: 
/data/data/com.googlecode.pythonforandroid/files/python/bin/python
E/ActivityManager(   64): Activity Manager Crash
E/ActivityManager(   64): java.lang.IllegalArgumentException: null notification
E/ActivityManager(   64):   at 
com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManage
rService.java:10962)
E/ActivityManager(   64):   at 
android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:596)
E/ActivityManager(   64):   at 
com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.j
ava:1539)
E/ActivityManager(   64):   at android.os.Binder.execTransact(Binder.java:287)
E/ActivityManager(   64):   at dalvik.system.NativeStart.run(Native Method)
E/sl4a.ForegroundService:40(  482): Error
E/sl4a.ForegroundService:40(  482): java.lang.reflect.InvocationTargetException
E/sl4a.ForegroundService:40(  482):     at 
android.app.Service.startForeground(Service.java:474)
E/sl4a.ForegroundService:40(  482):     at 
java.lang.reflect.Method.invokeNative(Native Method)
E/sl4a.ForegroundService:40(  482):     at 
java.lang.reflect.Method.invoke(Method.java:521)
E/sl4a.ForegroundService:40(  482):     at 
com.googlecode.android_scripting.ForegroundService.startForegroundCompat(Foregro
undService.java:38)
E/sl4a.ForegroundService:40(  482):     at 
com.googlecode.android_scripting.ForegroundService.onCreate(ForegroundService.ja
va:84)
E/sl4a.ForegroundService:40(  482):     at 
com.mudsmagicalsoftware.mudvoicer.ScriptService.onCreate(ScriptService.java:79)
E/sl4a.ForegroundService:40(  482):     at 
android.app.ActivityThread.handleCreateService(ActivityThread.java:2780)
E/sl4a.ForegroundService:40(  482):     at 
android.app.ActivityThread.access$3200(ActivityThread.java:119)
E/sl4a.ForegroundService:40(  482):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
E/sl4a.ForegroundService:40(  482):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
E/sl4a.ForegroundService:40(  482):     at android.os.Looper.loop(Looper.java:123)
E/sl4a.ForegroundService:40(  482):     at 
android.app.ActivityThread.main(ActivityThread.java:4363)
E/sl4a.ForegroundService:40(  482):     at 
java.lang.reflect.Method.invokeNative(Native Method)
E/sl4a.ForegroundService:40(  482):     at 
java.lang.reflect.Method.invoke(Method.java:521)
E/sl4a.ForegroundService:40(  482):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/sl4a.ForegroundService:40(  482):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/sl4a.ForegroundService:40(  482):     at dalvik.system.NativeStart.main(Native 
Method)
E/sl4a.ForegroundService:40(  482): Caused by: 
java.lang.IllegalArgumentException: null notification
E/sl4a.ForegroundService:40(  482):     at 
android.os.Parcel.readException(Parcel.java:1222)
E/sl4a.ForegroundService:40(  482):     at 
android.os.Parcel.readException(Parcel.java:1206)
E/sl4a.ForegroundService:40(  482):     at 
android.app.ActivityManagerProxy.setServiceForeground(ActivityManagerNative.java
:1796)
E/sl4a.ForegroundService:40(  482):     ... 17 more
D/sl4a.ScriptService:156(  482): Checking if 
/data/data/com.mudsmagicalsoftware.mudvoicer/files/script.py exists
D/sl4a.ScriptService:163(  482): Comparing file with content
D/sl4a.ScriptService:178(  482): No need to update 
/data/data/com.mudsmagicalsoftware.mudvoicer/files/script.py
I/dalvikvm(  482): Could not find method 
com.google.common.collect.Maps.newHashMap, referenced from method 
com.googlecode.android_scripting.facade.FacadeConfiguration.collectStartEventMet
hodDescriptors
W/dalvikvm(  482): VFY: unable to resolve static method 446: 
Lcom/google/common/collect/Maps;.newHashMap ()Ljava/util/HashMap;
D/dalvikvm(  482): VFY: replacing opcode 0x71 at 0x0000
D/dalvikvm(  482): Making a copy of 
Lcom/googlecode/android_scripting/facade/FacadeConfiguration;.collectStartEventM
ethodDescriptors code (156 bytes)
I/dalvikvm(  482): Could not find method 
com.google.common.collect.Maps.newHashMap, referenced from method 
com.googlecode.android_scripting.facade.FacadeConfiguration.collectStopEventMeth
odDescriptors
W/dalvikvm(  482): VFY: unable to resolve static method 446: 
Lcom/google/common/collect/Maps;.newHashMap ()Ljava/util/HashMap;
D/dalvikvm(  482): VFY: replacing opcode 0x71 at 0x0000
D/dalvikvm(  482): Making a copy of 
Lcom/googlecode/android_scripting/facade/FacadeConfiguration;.collectStopEventMe
thodDescriptors code (156 bytes)
W/ActivityManager(   64): Activity pause timeout for HistoryRecord{44c3ca50 
com.mudsmagicalsoftware.mudvoicer/.ScriptActivity}
W/InputManagerService(   64): Window already focused, ignoring focus gain of: 
com.android.internal.view.IInputMethodClient$Stub$Proxy@44d47a08
D/dalvikvm(  482): GC freed 5757 objects / 412728 bytes in 291ms
I/dalvikvm(  482): Could not find method 
com.google.common.collect.Lists.newArrayList, referenced from method 
com.googlecode.android_scripting.SimpleServer.<init>
W/dalvikvm(  482): VFY: unable to resolve static method 445: 
Lcom/google/common/collect/Lists;.newArrayList ()Ljava/util/ArrayList;
D/dalvikvm(  482): VFY: replacing opcode 0x71 at 0x000a
D/dalvikvm(  482): Making a copy of 
Lcom/googlecode/android_scripting/SimpleServer;.<init> code (56 bytes)
D/AndroidRuntime(  482): Shutting down VM
W/dalvikvm(  482): threadid=3: thread exiting with uncaught exception 
(group=0x4001b188)
E/AndroidRuntime(  482): Uncaught handler: thread main exiting due to uncaught 
exception
E/AndroidRuntime(  482): java.lang.NoClassDefFoundError: 
com.google.common.collect.Lists
E/AndroidRuntime(  482):    at 
com.googlecode.android_scripting.SimpleServer.<init>(SimpleServer.java:43)
E/AndroidRuntime(  482):    at 
com.googlecode.android_scripting.jsonrpc.JsonRpcServer.<init>(JsonRpcServer.java
:51)
E/AndroidRuntime(  482):    at 
com.googlecode.android_scripting.AndroidProxy.<init>(AndroidProxy.java:55)
E/AndroidRuntime(  482):    at 
com.mudsmagicalsoftware.mudvoicer.ScriptService.onStart(ScriptService.java:125)
E/AndroidRuntime(  482):    at 
android.app.Service.onStartCommand(Service.java:306)
E/AndroidRuntime(  482):    at 
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2873)
E/AndroidRuntime(  482):    at 
android.app.ActivityThread.access$3500(ActivityThread.java:119)
E/AndroidRuntime(  482):    at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
E/AndroidRuntime(  482):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  482):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  482):    at 
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime(  482):    at java.lang.reflect.Method.invokeNative(Native 
Method)
E/AndroidRuntime(  482):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  482):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime(  482):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime(  482):    at dalvik.system.NativeStart.main(Native Method)
I/Process (   64): Sending signal. PID: 482 SIG: 3
I/dalvikvm(  482): threadid=7: reacting to signal 3
I/dalvikvm(  482): Wrote stack trace to '/data/anr/traces.txt'
D/dalvikvm(  242): GC freed 43 objects / 2104 bytes in 121ms
W/ActivityManager(   64): Activity destroy timeout for HistoryRecord{44c3ca50 
com.mudsmagicalsoftware.mudvoicer/.ScriptActivity}
W/ActivityManager(   64): Timeout executing service: ServiceRecord{44fb1398 
com.mudsmagicalsoftware.mudvoicer/.ScriptService}

Original comment by ebben.fe...@gmail.com on 17 May 2011 at 8:01

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

This has been addressed in the unnofficial release all ready. Make sure 
guava-r06.jar is part of your classpath when building the project.

Original comment by naranjo....@gmail.com on 17 May 2011 at 12:38