Search code examples
androidgradlegoogle-play-servicesdex

transformClassesWithDexForDebug using IndoorAtlas Library


I try to use IndoorAtlas Android SDK example. I follow this guide.

But when I try to run it i get this error:

Error:Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.lang.Object[] using a local variable of type com.indooratlas.android.sdk.IAGeofenceRequest. This is symptomatic of .class transformation tools that ignore local variable information.

Error:1 error; aborting

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex '/Users/xxx/AndroidStudioProjects/IndoorLocalization/app/libs/indooratlas-android-sdk-2.5.1.jar' to '/Users/xxx/AndroidStudioProjects/IndoorLocalization/app/build/intermediates/transforms/dex/debug/folders/1000/10/indooratlas-android-sdk-2.5.1_dbe918a8d06cf55c975257e4802cd6d4f4f48ea4'

How can i solve this issue?


Solution

  • IndoorAtlas Android SDK 2.5.1 had a bug with proguard opimizations. Use the newer 2.5.2 version which has this bug fixed. Version 2.5.2 can be used by specifying

    dependencies {
        ...
        compile 'com.indooratlas.android:indooratlas-android-sdk:2.5.2'
        ...
    }
    

    in your applications build.gradle file.