problem when i tried to integrate the Module(android) in my titanium app.

You must Login before you can answer or comment on any questions.

Integrade it and after i added in tiapp.xml:

<modules> <module platform="android" version="1">com.android.manager</module> </modules>

After i try to install it in my device, i get the error:

[ERROR] System Error while compiling Android classes.dex [ERROR] [ERROR] UNEXPECTED TOP-LEVEL EXCEPTION: [ERROR] java.lang.IllegalArgumentException: already added: Lorg/w3c/dom/UserDataHandler; [ERROR] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) [ERROR] at com.android.dx.dex.file.DexFile.add(DexFile.java:163) [ERROR] at com.android.dx.command.dexer.Main.processClass(Main.java:486) [ERROR] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455) [ERROR] at com.android.dx.command.dexer.Main.access$400(Main.java:67) [ERROR] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109) [ERROR] at com.android.dx.command.dexer.Main.processOne(Main.java:418) [ERROR] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329) [ERROR] at com.android.dx.command.dexer.Main.run(Main.java:206) [ERROR] at com.android.dx.command.dexer.Main.main(Main.java:174) [ERROR] at com.android.dx.command.Main.main(Main.java:91) [ERROR] 1 error; aborting

— asked 8 months ago by petur danailovbiseraol
5 Comments
    • Which module are we talking about here?
    • Which version of the SDK?
    • On which version of Android are you running?
    • On which device?

    I'm sure you seen a pattern with my questions here. If you want people to have a better understanding the problem you are facing, you need to provide us with all the information that could be relevant.

    Especially with modules that add an additional layer of complexity.

    — commented 8 months ago by Christian Brousseau

  • Thank you,

    I use Titanium studio build: 2.1.2.201208301612 Titanium SDK version: 2.1.3.GA

    When I create a new titanium project I use Default Android version 2.2;

    After i create a new Module(New titanium mobile module project Titanium SDK ver: 2.1.3.GA.

    In my module i start with:

    @Kroll.module(name="SensorManager", id="com.android.manager") public class SensorManagerModule extends KrollModule implements SensorEventListener { ... ...

    then i have:
    
    @Override
    public void onSensorChanged(SensorEvent event)
    {
    
         switch (event.sensor.getType()) {
            case Sensor.TYPE_ACCELEROMETER:   data.put(&quot;accelerometer&quot;, getAccelerometer(event));
            break;
    
            case Sensor.TYPE_GYROSCOPE:  data.put(&quot;gyroscope&quot;, getGyro(event));
            break;
    
            case Sensor.TYPE_ORIENTATION:  data.put(&quot;orientation&quot;, getOrientation(event));
            break;
    
            case Sensor.TYPE_LIGHT: data.put(&quot;light&quot;, getLight(event));
            break;
    
            case Sensor.TYPE_TEMPERATURE:  data.put(&quot;temp&quot;, getTemp(event));
            break;
    
            case Sensor.TYPE_MAGNETIC_FIELD:  data.put(&quot;magnetic&quot;, getMagneticField(event));
            break;
    
            case Sensor.TYPE_PRESSURE:  data.put(&quot;pressure&quot;, getPressure(event));
            break;
    
            case Sensor.TYPE_PROXIMITY:  data.put(&quot;proximity&quot;, getProximity(event));
            break;
        }
            fireEvent(EVENT_UPDATE, data);
    }
    
    ...
    

    }

    Then i use the option on my module "publish" - A mobile app , and i choose my app.

    After in my app i see in: tiapp.xml ->

    <modules> <module platform="android" version="1">com.android.manager</module> <module platform="commonjs" version="2.3.0">ti.cloud</module> </modules>

    and in my app.js i use: var calc = require("com.android.manager");

    This is all and i get the erorrs.

    — commented 8 months ago by petur danailovbiseraol

  • My version of android on my device is 2.3.7

    — commented 8 months ago by petur danailovbiseraol

  • Show 2 more comments

Your Answer

Think you can help? Login to answer this question!