prashantsaini1 / android-titanium-imagecropper

Image cropping for Android/Titanium
Apache License 2.0
25 stars 5 forks source link

Error while compiling app with module in place #4

Closed developer82 closed 6 years ago

developer82 commented 6 years ago

When compiling the app with the module in place it fails with the following error:

[ERROR] Failed to run dexer:
[ERROR]
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/media/ExifInterface;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/media/ExifInterface$1;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/media/ExifInterface$ByteOrderedDataInputStream;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/media/ExifInterface$ByteOrderedDataOutputStream;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/media/ExifInterface$ExifAttribute;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/media/ExifInterface$ExifTag;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/media/ExifInterface$IfdType;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/media/ExifInterface$Rational;
[ERROR] 8 errors; aborting
Build failed. Process exited with code 1.
linron commented 6 years ago

I get the same error!

prashantsaini1 commented 6 years ago

@linron can you provide some more details like which module it's crashing with and the Android OS version along with Ti SDK version you used at the time of this error?

linron commented 6 years ago

The module fails with SDK 7.4.0.

<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest android:versionCode="8">
            <application android:theme="@style/appcelerator"/>
            <uses-sdk android:targetSdkVersion="26"/>
            <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
            <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
            <uses-permission android:name="android.permission.CAMERA"/>
            <uses-feature android:name="android.hardware.camera"/>
        </manifest>
    </android>
    <property name="ti.android.threadstacksize" type="int">131072</property>
    <property name="ti.android.httpclient.maxbuffersize" type="int">131072</property>
    <modules>
        <module platform="android">ti.barcode</module>
        <module platform="iphone">ti.barcode</module>
        <module platform="commonjs">ti.cloud</module>
        <module platform="android">in.prashant.imagecrop</module>
        <module platform="iphone">ti.imagefactory</module>
        <module platform="android">ti.imagefactory</module>
    </modules>
prashantsaini1 commented 6 years ago

Seems it's failing due to ti.imagefactory module which might be using the different ExifInterface lib. Can you try by removing ti.imagefactory and then ti.barcode to actually know which module is conflicting with image-cropper?

linron commented 6 years ago

I have tried to remove all other modules and still get an error when packaging for android.

prashantsaini1 commented 6 years ago

This module is using the ExifInterface library which was actually missing at the time of this module creation in SDK 7.1.1.GA. But titanium sdk 7.4.0 has a different version of this lib and I will need to recompile my module using that library. You will have to either wait till I update it by end of this week or you can grab the source code and do a recompile with the SDK exifinterface.jar lib.

linron commented 6 years ago

Thx for the quick reply - I will wait fro the update!

prashantsaini1 commented 6 years ago

Issue has been resolved by removing classes.jar file from lib folder as it was already being included by Titanium SDK 7.4.0.

Please find the fixed module version 3.0.0 here : https://github.com/prashantsaini1/android-titanium-imagecropper/blob/master/android/dist/in.prashant.imagecrop-android-3.0.0.zip