
当我将目标sdk级别从23.0.2更改为25.0.1时,我的应用程序在以下行崩溃了.
我应该怎么做才能避免这种崩溃?
请提出更改建议.
InstanceID instanceID = InstanceID.getInstance(getContext());错误日志:
AndroIDRuntime: FATAL EXCEPTION: AsyncTask #2Process: com.tuitoapp.admin, PID: 19012 java.lang.RuntimeException: An error occured while executing doInBackground()Caused by: java.lang.IllegalAccessError: Method 'voID androID.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.Google.androID.gms.iID.zzd' (declaration of 'com.Google.androID.gms.iID.zzd' appears in /data/data/com.tuitoapp.admin/files/instant-run/dex/slice-com.Google.androID.gms-play-services-gcm-8.3.0_7fd6e981c2dc6578e4c382ecd19f08197a01f8b5-classes.dex) at com.Google.androID.gms.iID.zzd.zzdL(UnkNown Source) at com.Google.androID.gms.iID.InstanceID.zza(UnkNown Source) at com.Google.androID.gms.iID.InstanceID.getInstance(UnkNown Source)我的应用程序优先级是:
// compile filetree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'org.achartengine:achartengine:1.2.0' compile('com.crashlytics.sdk.androID:crashlytics:2.6.2@aar') { transitive = true; } compile 'org.Jsoup:Jsoup:1.8.3' compile 'com.mcxiaoke.volley:library:1.0.19' compile 'com.androID.support:appcompat-v7:25.1.1' compile 'com.androID.support:design:25.1.1' compile 'com.pkmmte.vIEw:circularimagevIEw:1.1' compile 'com.androID.support:cardvIEw-v7:25.0.1' compile 'org.achartengine:achartengine:1.2.0' compile 'com.github.npanigrahy:Custom-Calendar-VIEw:v1.0' compile 'com.github.siyamed:androID-shape-imagevIEw:0.9.+@aar' compile 'com.Google.androID.gms:play-services:8.3.0' compile 'com.androID.support:multIDex:1.0.1' // compile 'com.Google.androID.gms:play-services:9.8.0 // compile 'com.Google.androID.gms:play-services:9.8.0' compile 'com.androID.support:multIDex:1.0.1' compile 'pub.devrel:easypermissions:0.1.9' compile 'com.github.ksoichiro:androID-observablescrollvIEw:1.6.0' compile 'pl.droIDsonroIDs.gif:androID-gif-drawable:1.1.16' compile 'com.miguelcatalan:materialsearchvIEw:1.4.0' compile 'com.github.rey5137:material:1.2.2' compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.github.blackfizz:eazegraph:1.2.5l@aar' compile 'com.github.PhilJay:MPAndroIDChart:v2.1.6' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.nineoldandroIDs:library:2.4.0' compile 'de.hdodenhof:circleimagevIEw:2.1.0' compile 'com.github.bumptech.glIDe:glIDe:3.7.0' compile 'com.androID.support:palette-v7:25.0.1' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' compile('com.weiwangcn.betterspinner:library:1.1.0') { exclude group: 'com.androID.support', module: 'appcompat-v7' } compile 'swarajsaaj:otpreader:1.0' compile 'com.flipboard:bottomsheet-core:1.4.3' compile 'com.flipboard:bottomsheet-commons:1.4.3' compile 'com.riontech.staggeredtextgrIDvIEw:staggeredtextgrIDvIEw:1.0.1' compile 'konifar:fab-transformation:1.0.0' compile project(':flickabledialog') compile 'com.androID.support:support-v4:25.0.1'}apply plugin:'com.Google.gms.Google-services'应用程序的主要优点是:
buildscript { repositorIEs { jcenter() mavenCentral() maven { url "https://jitpack.io" } } dependencIEs { classpath 'com.androID.tools.build:gradle:2.2.3'//These two lines are added classpath 'com.Google.gms:Google-services:1.5.0-beta2' //classpath 'com.Google.gms:Google-services:3.0.0' // classpath 'com.androID.tools.build:gradle:2.0.0-Alpha6' classpath 'com.androID.tools.build:gradle:1.3.0' classpath 'com.novoda:bintray-release:0.3.4' // classpath 'com.Google.gms:Google-services:2.0.0-Alpha3' // NOTE: Do not place your application dependencIEs here; they belong // in the indivIDual module build.gradle files }}task clean(type: Delete) { delete rootProject.buildDir}解决方法:
尝试这个:
InstanceID instanceID = InstanceID.getInstance(getApplicationContext());也在build.gradle中:
compile("com.Google.androID.gms:play-services-location:9.6.1") //if u are not using location you can skip thiscompile("com.Google.androID.gms:play-services-maps:9.6.1")compile("com.Google.androID.gms:play-services-gcm:9.6.1")并在您的应用程序gradle中:
删除类路径’com.Google.gms:Google-services:1.5.0-beta2′
还为什么使用两个不同的com.androID.tools.build:gradle版本?
总结以上是内存溢出为你收集整理的java.lang.IllegalAccessError:方法’void android.support.v4.content.ContextCompat.’类’com.google.android.全部内容,希望文章能够帮你解决java.lang.IllegalAccessError:方法’void android.support.v4.content.ContextCompat.’类’com.google.android.所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)