Android AdMob运行时出现间歇性java.lang.NoClassDefFoundError
我的一些用户由于一个错误而崩溃。。这次崩溃的手机是运行安卓9的谷歌像素。但是,并非所有像素都会因此配置而崩溃。报告此次崩溃的两台设备是安卓9上的谷歌Pixel 2(walleye)和安卓9上的Pixel XL(marlin)。我们有相同设备和Android版本的用户没有错误,我们无法在模拟器中重现错误 以下是报告的堆栈跟踪:Android AdMob运行时出现间歇性java.lang.NoClassDefFoundError,android,admob,noclassdeffounderror,Android,Admob,Noclassdeffounderror,我的一些用户由于一个错误而崩溃。。这次崩溃的手机是运行安卓9的谷歌像素。但是,并非所有像素都会因此配置而崩溃。报告此次崩溃的两台设备是安卓9上的谷歌Pixel 2(walleye)和安卓9上的Pixel XL(marlin)。我们有相同设备和Android版本的用户没有错误,我们无法在模拟器中重现错误 以下是报告的堆栈跟踪: java.lang.NoClassDefFoundError: at jq.b (jq.java:3) at jp.a (jp.java:3) at jr.a
java.lang.NoClassDefFoundError:
at jq.b (jq.java:3)
at jp.a (jp.java:3)
at jr.a (jr.java:19)
at com.google.android.gms.ads.internal.util.ap.a (ap.java:15)
at iv.a (iv.java:19)
at iv.run (iv.java:8)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass (ClassLoader.java:379)
at ac.loadClass (ac.java:4)
at java.lang.ClassLoader.loadClass (ClassLoader.java:312)
at jq.b (jq.java:3)
at jp.a (jp.java:3)
at jr.a (jr.java:19)
at com.google.android.gms.ads.internal.util.ap.a (ap.java:15)
at iv.a (iv.java:19)
at iv.run (iv.java:8)
这是我的公共库的build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
libraryVariants.all { variant ->
variant.outputs.all {
def version = variant.properties.get("versionName")
def projectName = name
def formattedDate = new Date().format('yyyy-MM-dd-HHmm')
outputFileName = "${projectName}${version}-${formattedDate}.apk"
}
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 6
versionName "3.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
dependencies {
implementation 'com.google.android.gms:play-services-ads:15.0.1'
}
}
这是我的应用程序的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.myapp"
minSdkVersion 14
targetSdkVersion 28
versionCode 9
versionName "2.6.2"
testApplicationId "com.myapp"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
signingConfig signingConfigs.appkey
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
zipAlignEnabled true
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
def relativeRootDir = output.packageApplication.outputDirectory.toPath()
.relativize(rootDir.toPath()).toFile()
def finalVersionCode = versionCode
output.versionCodeOverride = finalVersionCode
outputFileName = new File(
"$relativeRootDir/release",
outputFileName.replace(".apk", "-${finalVersionCode}.apk"))
}
}
debuggable true
jniDebuggable true
}
debug {
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '28.0.3'
productFlavors {
}
}
dependencies {
implementation project(':common')
implementation 'com.google.android.gms:play-services-ads:15.0.1'
}
如中所述,在我们等待谷歌正式修复这一问题时,似乎有一个临时解决办法。地图库也会受到影响
只需将此标记放入清单文件:
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
我试过了,它似乎起作用了。我也有这个问题。你找到解决办法了吗?不幸的是,还没有。这很不一致。没有押韵或理由(你找到这个问题的解决方案了吗?我的应用程序用户没有人不联系我告诉我他们有一些问题。也许这只是在GP控制台注册的?