0
Help us understand the problem. What are the problem?

posted at

Androidのgradle versionを上げたら起動しなくなった

Gradle versionをポチポチと最新版に変更

gradle-7.0.2-all.zip -> gradle-7.4.2-bin.zip

distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-all.zip
-> distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-bin.zip

gradle:7.0.4 -> gradle:7.2.1

classpath 'com.android.tools.build:gradle:7.0.4'
-> classpath 'com.android.tools.build:gradle:7.2.1'

上げて動かそうとしたら。。。起動せず。

Non-fatal Exception: java.lang.RuntimeExceptionMissing type parameter.

Non-fatal Exception: java.lang.RuntimeException
Missing type parameter.
com.google.gson.reflect.TypeToken.getSuperclassTypeParameter (TypeToken.java:84)
com.google.gson.reflect.TypeToken.<init> (TypeToken.java:62)

解決方法

proguard-rules.proに下記を追加

# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

まだ openだけど解決したIssues
https://github.com/google/gson/issues/2069

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
0
Help us understand the problem. What are the problem?