我在应用程序的发布版中遇到了一个奇怪的问题。以下是我的异常信息:
Fatal Exception: java.lang.NullPointerException`
throw with null exception
in.hopq.hopq.authentication.models.AppUpdateSourceDO$AppUpdate.getMinAllowedVersion (AppUpdateSourceDO.java:3)
in.hopq.hopq.authentication.activities.SplashActivity$onCreate$1.onChanged (SplashActivity.java:48)
in.hopq.hopq.authentication.activities.SplashActivity$onCreate$1.onChanged (SplashActivity.java:31)
普通Java对象文件
data class AppUpdateSourceDO(
@SerializedName("app_update")
val appUpdate: AppUpdate,
@SerializedName("message")
val message: String,
@SerializedName("success")
val success: Boolean
) {
data class AppUpdate(
@SerializedName("excluded_versions")
val excludedVersions: List<ExcludedVersion>,
@SerializedName("min_allowed_version")
val minAllowedVersion: Int,
@SerializedName("min_allowed_version_ios")
val minAllowedVersionIos: String,
@SerializedName("recommended_version")
val recommendedVersion: Int?
) {
data class ExcludedVersion(
@SerializedName("version")
val version: String
)
}
}
这是我的proguard文件
##OKHTTP3
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-dontnote okhttp3.**
-dontwarn okio.**
-dontwarn retrofit2.Platform$Java8
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*