gpt4 book ai didi

android - Landroid/content/pm/PackageInfo 类中没有虚方法 getLongVersionCode()J

转载 作者:行者123 更新时间:2023-12-03 16:57:13 29 4
gpt4 key购买 nike

在谷歌上玩这个错误

FATAL EXCEPTION: main Process: com.sonymobile.scan3d, PID: 13877 java.lang.NoSuchMethodError: No virtual method getLongVersionCode()J in class Landroid/content/pm/PackageInfo; or its super classes (declaration of 'android.content.pm.PackageInfo' appears in /system/framework/framework.jar) at com.sonymobile.scan3d.ZipResourceManager.initializeExpansionFilePath(ZipResourceManager.java:100) at com.sonymobile.scan3d.ZipResourceManager.(ZipResourceManager.java:113) at com.sonymobile.scan3d.ZipResourceManager.init(ZipResourceManager.java:65) at com.sonymobile.scan3d.Scan3DApp.onCreate(Scan3DApp.java:55) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5822) at android.app.ActivityThread.-wrap1(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:251) at android.app.ActivityThread.main(ActivityThread.java:6572) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)



仅在 Xperia XZ1 Compact(Android 8.0) 设备测试上显示...我认为这个问题只会让我在世界范围内担心,帮助我,我不知道如何处理这个错误

默认配置 {
    applicationId "xxxx.xxxxx.xxxxx"
minSdkVersion 16
targetSdkVersion 28
versionCode 23
versionName "3.3"
multiDexEnabled true
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dependencies {

implementation 'com.google.android.gms:play-services-ads:18.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.android.billingclient:billing:2.0.3'
implementation 'androidx.annotation:annotation:1.1.0'
}

最佳答案

根据 getLongVersionCode() documentation ,该方法是在 API 级别 28 即 Android 9 中添加的,因此预计该方法在 Android 8 设备上不存在。

最新版本的 AndroidX Core 包含 PackageInfoCompat.getLongVersionCode(PackageInfo) 适用于所有 API 级别的方法。

关于android - Landroid/content/pm/PackageInfo 类中没有虚方法 getLongVersionCode()J,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58262903/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com