我遇到了一个奇怪的问题。当我通过 Gradle 编译 BaseGameUtils 库时,我的应用程序在 Vungle 初始化时崩溃。
我真的不知道为什么会这样,我什至不知道我应该向你展示什么来帮助我解决这个问题。
这是错误消息:
java.lang.NoClassDefFoundError: com.vungle.publisher.sj
at com.vungle.publisher.ta.<init>(vungle:1922)
at com.vungle.publisher.ta.<init>(vungle:720)
at com.vungle.publisher.VunglePubBase.init(vungle:97)
at com.vungle.publisher.VunglePub.init(vungle:33)
at com.swipe.game.AndroidLauncher.onCreate(AndroidLauncher.java:101)
at android.app.Activity.performCreate(Activity.java:5122)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1150)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
at android.app.ActivityThread.access$600(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5391)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
t com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
但这并不能说明我的意见。
还提供 AndroidManifest(baseutils)和 Gradle 文件(baseutils)。
显现:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="com.google.example.games.basegameutils"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="23"/>
<application>
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</application>
摇篮:
apply plugin: 'com.android.library'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
}
}
dependencies {
compile "com.android.support:appcompat-v7:24.2.0"
compile "com.android.support:support-v4:24.2.0"
compile "com.google.android.gms:play-services-games:9.4.0"
compile "com.google.android.gms:play-services-plus:9.4.0"
}
android {
// Set defaults so that BaseGameUtils can be used outside of BasicSamples
if (!project.hasProperty('android_compile_version')) {
ext.android_compile_version = 23
}
if (!project.hasProperty('android_version')) {
ext.android_version = '23'
}
compileSdkVersion android_compile_version
buildToolsVersion android_version
}
希望有人可以帮我解决这个问题。随意询问您需要的其他代码示例。谢谢。