#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    72
    Rep Power
    12

    Building Jython for Android


    I am attempting to build Jython for the Android platform (Jythonroid) I know this is a dead project but I still see some merit in it. Anyway using eclipse to build the project.

    I get the following errors

    Code:
    
    [2011-04-10 13:35:51 - Jythonroid] Dx 
    trouble processing "javax/net/ServerSocketFactory.class":
    
    Ill-advised or mistaken usage of a core class (java.* or javax.*)
    when not building a core library.
    
    This is often due to inadvertently including a core library file
    in your application's project, when using an IDE (such as
    Eclipse). If you are sure you're not intentionally defining a
    core class, then this is the most likely explanation of what's
    going on.
    
    However, you might actually be trying to define a class in a core
    namespace, the source of which you may have taken, for example,
    from a non-Android virtual machine project. This will most
    assuredly not work. At a minimum, it jeopardizes the
    compatibility of your app with future versions of the platform.
    It is also often of questionable legality.
    
    If you really intend to build a core library -- which is only
    appropriate as part of creating a full virtual machine
    distribution, as opposed to compiling an application -- then use
    the "--core-library" option to suppress this error message.
    
    If you go ahead and use "--core-library" but are in fact
    building an application, then be forewarned that your application
    will still fail to build or run, at some point. Please be
    prepared for angry customers who find, for example, that your
    application ceases to function once they upgrade their operating
    system. You will be to blame for this problem.
    
    If you are legitimately using some code that happens to be in a
    core package, then the easiest safe alternative you have is to
    repackage that code. That is, move the classes in question into
    your own package namespace. This means that they will never be in
    conflict with core system classes. JarJar is a tool that may help
    you in this endeavor. If you find that you cannot do this, then
    that is an indication that the path you are on will ultimately
    lead to pain, suffering, grief, and lamentation.
    
    [2011-04-10 13:35:51 - Jythonroid] Dx 1 error; aborting
    [2011-04-10 13:35:51 - Jythonroid] Conversion to Dalvik format failed with error 1
    in eclipse it said I needed to set the --core-library option. but I could not find a solution to do this. I am including core libraries which may not be the best solution but I just want a binary Does anyone know how to set the "core library" flag

    *cheers

    This is just a quick edit. I created a build.xml using "android update" etc I figured it would be possible to add --core-library flag to it but I have had no luck in doing this if anyone can recommend how to set this option in build.xml that would work also
    Last edited by maboroshi; April 10th, 2011 at 04:57 PM. Reason: More Info
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    72
    Rep Power
    12

    Update Binary Compiled crashes


    I was able to build a debug binary using ant and the command line with success

    However the app crashes here is the output of logcat. Any ideas where to trouble shoot this would be gretaly appreciated

    cheers

    Code:
    I/ActivityManager(   51): Starting activity: Intent { act=android.intent.action.
    MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.python.util/.
    Jythonroid }
    I/ActivityManager(   51): Start proc org.python.util for activity org.python.uti
    l/.Jythonroid: pid=190 uid=10028 gids={1015}
    D/dalvikvm(   30): GC freed 284 objects / 10864 bytes in 318ms
    D/dalvikvm(   30): GC freed 50 objects / 2216 bytes in 117ms
    D/dalvikvm(   30): GC freed 2 objects / 48 bytes in 96ms
    D/dalvikvm(   51): GC freed 13347 objects / 617528 bytes in 195ms
    I/ARMAssembler(   51): generated scanline__00000177:03515104_00000001_00000000 [
     73 ipp] (95 ins) at [0x4c0640:0x4c07bc] in 894130 ns
    I/ARMAssembler(   51): generated scanline__00000077:03545404_00000004_00000000 [
     47 ipp] (67 ins) at [0x4c19b0:0x4c1abc] in 640894 ns
    D/AndroidRuntime(  190): Shutting down VM
    W/dalvikvm(  190): threadid=3: thread exiting with uncaught exception (group=0x4
    001b188)
    E/AndroidRuntime(  190): Uncaught handler: thread main exiting due to uncaught e
    xception
    E/AndroidRuntime(  190): java.lang.RuntimeException: Unable to start activity Co
    mponentInfo{org.python.util/org.python.util.Jythonroid}: java.lang.IllegalStateE
    xception: The specified child already has a parent. You must call removeView() o
    n the child's parent first.
    E/AndroidRuntime(  190):        at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2496)
    E/AndroidRuntime(  190):        at android.app.ActivityThread.handleLaunchActivi
    ty(ActivityThread.java:2512)
    E/AndroidRuntime(  190):        at android.app.ActivityThread.access$2200(Activi
    tyThread.java:119)
    E/AndroidRuntime(  190):        at android.app.ActivityThread$H.handleMessage(Ac
    tivityThread.java:1863)
    E/AndroidRuntime(  190):        at android.os.Handler.dispatchMessage(Handler.ja
    va:99)
    E/AndroidRuntime(  190):        at android.os.Looper.loop(Looper.java:123)
    E/AndroidRuntime(  190):        at android.app.ActivityThread.main(ActivityThrea
    d.java:4363)
    E/AndroidRuntime(  190):        at java.lang.reflect.Method.invokeNative(Native
    Method)
    E/AndroidRuntime(  190):        at java.lang.reflect.Method.invoke(Method.java:5
    21)
    E/AndroidRuntime(  190):        at com.android.internal.os.ZygoteInit$MethodAndA
    rgsCaller.run(ZygoteInit.java:860)
    E/AndroidRuntime(  190):        at com.android.internal.os.ZygoteInit.main(Zygot
    eInit.java:618)
    E/AndroidRuntime(  190):        at dalvik.system.NativeStart.main(Native Method)
    
    E/AndroidRuntime(  190): Caused by: java.lang.IllegalStateException: The specifi
    ed child already has a parent. You must call removeView() on the child's parent
    first.
    E/AndroidRuntime(  190):        at android.view.ViewGroup.addViewInner(ViewGroup
    .java:1861)
    E/AndroidRuntime(  190):        at android.view.ViewGroup.addView(ViewGroup.java
    :1756)
    E/AndroidRuntime(  190):        at android.view.ViewGroup.addView(ViewGroup.java
    :1736)
    E/AndroidRuntime(  190):        at com.android.internal.policy.impl.PhoneWindow.
    setContentView(PhoneWindow.java:217)
    E/AndroidRuntime(  190):        at com.android.internal.policy.impl.PhoneWindow.
    setContentView(PhoneWindow.java:207)
    E/AndroidRuntime(  190):        at android.app.Activity.setContentView(Activity.
    java:1633)
    E/AndroidRuntime(  190):        at org.python.util.Jythonroid.onCreate(Jythonroi
    d.java:251)
    E/AndroidRuntime(  190):        at android.app.Instrumentation.callActivityOnCre
    ate(Instrumentation.java:1047)
    E/AndroidRuntime(  190):        at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2459)
    E/AndroidRuntime(  190):        ... 11 more
    I/Process (   51): Sending signal. PID: 190 SIG: 3
    I/dalvikvm(  190): threadid=7: reacting to signal 3
    E/dalvikvm(  190): Unable to open stack trace file '/data/anr/traces.txt': Permi
    ssion denied
    I/ARMAssembler(   51): generated scanline__00000077:03515104_00000000_00000000 [
     33 ipp] (47 ins) at [0x4c1ac0:0x4c1b7c] in 405177 ns
    I/ARMAssembler(   51): generated scanline__00000177:03515104_00001001_00000000 [
     91 ipp] (114 ins) at [0x492b80:0x492d48] in 494049 ns
    W/ActivityManager(   51): Launch timeout has expired, giving up wake lock!
    W/ActivityManager(   51): Activity idle timeout for HistoryRecord{43db26a8 org.p
    ython.util/.Jythonroid}
    D/dalvikvm(   97): GC freed 965 objects / 44888 bytes in 164ms
    I/Process (  190): Sending signal. PID: 190 SIG: 9
    I/ActivityManager(   51): Process org.python.util (pid 190) has died.
    I/UsageStats(   51): Unexpected resume of com.android.launcher while already res
    umed in org.python.util
    W/InputManagerService(   51): Window already focused, ignoring focus gain of: co
    m.android.internal.view.IInputMethodClient$Stub$Proxy@43c6ef58
    E/gralloc (   51): [unregister] handle 0x3d0690 still locked (state=40000001)
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    72
    Rep Power
    12

    Problems Solved


    I solved my problems

    Thanks Anyway
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0
    Originally Posted by maboroshi
    I solved my problems

    Thanks Anyway

    How did you solve your problem?

    I get a DX 2 error message when trying to run an Android application with the jython jar in my classpath.

IMN logo majestic logo threadwatch logo seochat tools logo