我的應用程序在棒棒糖設備上運行良好,但它在版本棒棒糖之前不斷崩潰。 我已經簡單地實現我的應用程序下面的代碼,通過谷歌機制的文檔Android - 應用程序在Pre-Lollipop設備上崩潰
// Request for Ads
AdRequest adRequest = new AdRequest.Builder()
// Add a test device to show Test Ads
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
// Load ads into Banner Ads
mAdView.loadAd(adRequest);
使用
compileSdkVersion 23
buildToolsVersion "23.0.1"
清單
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden
|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
錯誤的一面旗幟添加
E/AndroidRuntime: FATAL EXCEPTION: main
E/AndroidRuntime: Process: com.app.aggro, PID: 13257
E/AndroidRuntime: java.lang.VerifyError:
com/google/android/gms/measurement/internal/zzv
E/AndroidRuntime: at
com.google.android.gms.measurement.AppMeasurementContentProvider
.onCreate(Unknown Source)
E/AndroidRuntime: at
android.content.ContentProvider.attachInfo(ContentProvider.java:1656)
E/AndroidRuntime: at
android.content.ContentProvider.attachInfo(ContentProvider.java:1627)
E/AndroidRuntime: at
android.app.ActivityThread.installProvider(ActivityThread.java:5015)
E/AndroidRuntime: at
android.app.ActivityThread.installContentProviders
(ActivityThread.java:4589)
E/AndroidRuntime: at
android.app.ActivityThread.handleBindApplication
(ActivityThread.java:4522)
E/AndroidRuntime: at
android.app.ActivityThread.access$1500(ActivityThread.java:151)
E/AndroidRuntime: at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
E/AndroidRuntime: at
android.os.Handler.dispatchMessage(Handler.java:110)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime: at
android.app.ActivityThread.main(ActivityThread.java:5299)
E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime: at
java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime: at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:825)
E/AndroidRuntime: at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
E/AndroidRuntime: at dalvik.system.NativeStart.main
(Native Method)
我的搖籃文件
apply plugin: 'com.android.application'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
repositories {
mavenCentral()
maven { url
"https://oss.sonatype.org/content/repositories/snapshots"}
maven { url 'https://maven.fabric.io/public' }
maven { url
"https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.app.aggro"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-
android.txt'), 'proguard-rules.pro'
}
}
dexOptions{
incremental true
javaMaxHeapSize "4g"
}
defaultConfig {
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile('com.mikepenz:materialdrawer:[email protected]') {
transitive = true
}
compile('com.github.florent37:materialviewpager:[email protected]') {
transitive = true
}
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.marshalchen.ultimaterecyclerview:library:0.3.11'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.jpardogo.googleprogressbar:library:1.2.0'
compile 'com.quinny898.library.persistentsearch:library:1.0.0-
SNAPSHOT'
compile project(':storage')
compile 'com.getbase:floatingactionbutton:1.10.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile files('libs/activeandroid-3.1-beta.jar')
compile 'com.android.support:design:23.0.1'
compile 'it.neokree:MaterialTabs:0.11'
compile 'com.miguelcatalan:materialsearchview:1.2.0'
}
請幫我從這個問題脫身。
檢查,如果谷歌'玩在使用'AdRequest'之前,項目中的服務'是可用的項目。 – Tauqir
是的,我已經包括在內,編譯爲'com.google.android.gms:play-services:8.1.0' 並且它正在使用棒棒糖,但它保留崩潰在奇巧 – Nirmal
發佈您的gradle文件。 –