0

I updated Android Studio to Flamingo, Gradle and libraries. After that the app worked well if installed from in the Emulator by Android Studio, but it failed if the app was installed form Play Store using the bundle. I think it worked it worked if installed from an .apk file.

I get the exception:

java.lang.IllegalArgumentException: class o4.b isn't parameterized
Ton
  • 9,235
  • 15
  • 59
  • 103

1 Answers1

2

Let me write here my solution in case it helps somebody else.

After many hours, it turned out that the exception happen in this code:

Type type = new TypeToken<ArrayList<String>>() {}.getType();

I needed that code for using Gson.fromJson() function.

The TypeToken was imported using this:

import com.google.common.reflect.TypeToken;

and I had to changed to:

import com.google.gson.reflect.TypeToken;

Then I faced another error:

RuntimeException: Missing type parameter

And I solved thanks to this answer: https://stackoverflow.com/a/72520577/1363087

In the proguard-rules.pro file I added this:

-keep class com.google.gson.reflect.TypeToken
-keep class * extends com.google.gson.reflect.TypeToken
-keep public class * implements java.lang.reflect.Type

All this made me lose a huge amount of time. I wish I hadn't updated Android Studio or the dependencies.

Ton
  • 9,235
  • 15
  • 59
  • 103