Open mihai-moldovan opened 6 years ago
Same issue here, I have the same environment MacOS with Android Studio v3.1.2 and Kotlin
.
Did you find any solution?
EDIT:
I solved by adding this no my gradle:
implementation group: 'joda-time', name: 'joda-time', version: '2.3'
I'm experiencing the same issue with jodatime and okhttp. However, I found the issue with okhttp dependency. In MobileBuy/gradle/dependencies.gradle okhttp dependency is declared as "com.squareup.okhttp3:logging-interceptor:$versions.okHttpVersion" instead of ""com.squareup.okhttp3:okhttp:$versions.okHttpVersion". Not sure what's wrong with jodatime, the answer above solves it however.
Trying to integrate the SDK into a new vanilla Android project doesn't seem to build. Once the build errors are fixed it then crashes at runtime when a simple graphql query is executed.
Starting a new vanilla Android Studio Kotlin project and adding the dependency in build.gradle (replacing compile with implementation or api) will not build the project, or it will crash at runtime
So far I found the following problems:
Invoke-customs are only supported starting with Android O (--min-api 26)
I fixed it by addingcompileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
in build.gradle -> androidOnce I do this, the project will build but it will crash at runtime.
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/joda/time/format/DateTimeFormat;
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/HttpUrl;
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/stream/JsonReader;
If I add the dependencies as they appear in the SDK code, the query succeeds with no crash.
I attached the small dummy project used to test this issue TestBuy.zip
EDIT: I'm using a MacOS with Android Studio v3.1.2 and Kotlin