3
我目前工作的一個Android應用程序這是在科特林編碼。 一切都很好,直到昨天,在某些時候,我開始有在logcat的,但此錯誤,發生這種情況時,不顯示應用程序的內容。以下是詳細說明:找不到類「kotlin.jvm.internal.DefaultConstructorMarker」
11-23 17:08:40.819 10472-10472/ch.XXX.XXX W/dalvikvm: DexOpt: resolve class illegal access: Lch/XXX/XXX/commons/features/CouponsManager; -> Lkotlin/jvm/internal/DefaultConstructorMarker;
11-23 17:08:40.819 10472-10472/ch.XXX.XXX E/dalvikvm: Could not find class 'kotlin.jvm.internal.DefaultConstructorMarker', referenced from method ch.XXX.XXX.commons.features.CouponsManager.<init>
11-23 17:08:40.819 10472-10472/ch.XXX.XXX W/dalvikvm: VFY: unable to resolve check-cast 3145 (Lkotlin/jvm/internal/DefaultConstructorMarker;) in Lch/XXX/XXX/commons/features/CouponsManager;
11-23 17:08:40.819 10472-10472/ch.XXX.XXX W/dalvikvm: DexOpt: resolve class illegal access: Lch/XXX/XXX/commons/features/CouponsManager; -> Lkotlin/jvm/internal/DefaultConstructorMarker;
被引用的類是在Kotlin中編寫的,在錯誤開始出現之前未被修改。
編輯
這裏是導致問題的類:
class CouponsManager(private val api: RestApi = RestApi()) {
fun getAllCoupons(): Observable<CouponDataResponse> {
return Observable.create { subscriber ->
val callResponse = api.getCoupons()
val response = callResponse.execute()
if (response.isSuccessful) {
val coupons = response.body()
subscriber.onNext(coupons)
subscriber.onCompleted()
} else {
subscriber.onError(Throwable(response.message()))
}
}
}
fun getCoupons(): Observable<List<Coupon>> {
return getAllCoupons().map {
it.Coupons.map {
Coupon(it.TopCouponImageUrl, it.BarcodeUrl, it.TopCouponText, it.BottomCouponText, it.BottomCouponImageUrl)
}
}
}
fun getLoyaltyCards(): Observable<List<Coupon>> {
return getAllCoupons().map {
it.Loyalty.map {
Coupon(it.TopCouponImageUrl, it.BarcodeUrl, it.TopCouponText, it.BottomCouponText, it.BottomCouponImageUrl)
}
}
}
}
你使用proguard的? –
@DimaRostopira不,它已被禁用。 – bontoJR
顯示此類然後 –