Skip to content

Instantly share code, notes, and snippets.

@iniyanmurugavel
Created June 29, 2020 08:09
Show Gist options
  • Select an option

  • Save iniyanmurugavel/646564173fc7519ea18355dc2fbcff95 to your computer and use it in GitHub Desktop.

Select an option

Save iniyanmurugavel/646564173fc7519ea18355dc2fbcff95 to your computer and use it in GitHub Desktop.
Androidx migration issues and Gson vs Moshi upgrade
If you have this in your gradle :
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
then you are telling android to use java 8.
then the problem happens if you are using a library that does not support java 8 (i.e it uses something from java 7 that is not allowed in java 8)
for me the problem happens because I had the following in my gradle
implementation 'com.google.code.gson:gson:2.8.6'
which seems not to support java 8 , I have solved it be removing the Gson library and used moshi instead of it for json to model parsing
https://stackoverflow.com/questions/49891730/invoke-customs-are-only-supported-starting-with-android-0-min-api-26
https://stackoverflow.com/questions/52889075/migrating-androidx-run-error-android-support-annotation-does-not-exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment