matomo-org / matomo-sdk-android

SDK for Android to measure your apps with Matomo. Works on Android phones, tablets, Fire TV sticks, and more!
BSD 3-Clause "New" or "Revised" License
388 stars 163 forks source link

Dex problems have returned #202

Closed amiralichesser3 closed 6 years ago

amiralichesser3 commented 6 years ago

Since the android studio new update, even enabling the D8 does not help and I still the the dex builder problem with piwikSdk

d4rken commented 6 years ago

What dex builder problem?

Please post used versions and the error itself.

amiralichesser3 commented 6 years ago

I'm using piwik version 3.0.1 , D8 is enabled and android studio version is 3.1.1

This is the error i get: Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/amirali/.gradle/wrapper/dists/gradle-4.1-all/bzyivzo6n839fup2jbap0tjew/gradle-4.1/caches/transforms-1/files-1.1/piwik-sdk-3.0.1.aar/f2791f8d750fa70532857317fd29f013/jars/classes.jar

d4rken commented 6 years ago

Is that the complete error? I think there should also be a stacktrace.

A google search for the error brings up: https://github.com/yandex/mapkit-android-demo/issues/2 which links: https://issuetracker.google.com/issues/77240639

This would be a bug in Android Studio 3.1's D8 dex compiler, the proposed solution is to deactivate D8 until it's fixed: android.enableD8=false

amiralichesser3 commented 6 years ago

I did try with the enableD8 = false. still i get the same error: (when i remove piwik from my dependencies everything is working just fine)

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/amirali/.gradle/wrapper/dists/gradle-4.1-all/bzyivzo6n839fup2jbap0tjew/gradle-4.1/caches/transforms-1/files-1.1/piwik-sdk-3.0.1.aar/f2791f8d750fa70532857317fd29f013/jars/classes.jar

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing org/piwik/sdk/extra/DownloadTracker.class

Caused by: com.android.dx.cf.code.SimException: ERROR in org.piwik.sdk.extra.DownloadTracker.trackNewAppDownload:(Lorg/piwik/sdk/TrackMe;Lorg/piwik/sdk/extra/DownloadTracker$Extra;)V: invalid opcode ba - invokedynamic requires --min-sdk-version >= 26 (currently 15)

d4rken commented 6 years ago

See

https://github.com/matomo-org/piwik-sdk-android/issues/196

rovkinmax commented 6 years ago

@d4rken solution from #196 is not help me, I already have compileOptions in my build.gradle file, but I still have exception

com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/rovkinmax/.gradle/caches/transforms-1/files-1.1/piwik-sdk-3.0.2.aar/3760fd43b5fab6eab41c6640bfdff7d0/jars/classes.jar