昨天我将手机的软件更新为新的Android Pie,突然我的android studio项目停止运行,日志中包含以下代码:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.user.mahaluz, PID: 26774
java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
at android.graphics.Canvas.clipRect(Canvas.java:918)
at com.alamkanak.weekview.WeekView.drawHeaderRowAndEvents(WeekView.java:591)
at com.alamkanak.weekview.WeekView.onDraw(WeekView.java:488)
at android.view.View.draw(View.java:21859)
at android.view.View.updateDisplayListIfDirty(View.java:20732)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.draw(View.java:21862)
at com.android.internal.policy.DecorView.draw(DecorView.java:1083)
at android.view.View.updateDisplayListIfDirty(View.java:20732)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:725)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:731)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:840)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3909)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3683)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2991)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1850)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8455)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
E/UncaughtException: java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
at android.graphics.Canvas.clipRect(Canvas.java:918)
at com.alamkanak.weekview.WeekView.drawHeaderRowAndEvents(WeekView.java:591)
at com.alamkanak.weekview.WeekView.onDraw(WeekView.java:488)
at android.view.View.draw(View.java:21859)
at android.view.View.updateDisplayListIfDirty(View.java:20732)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.updateDisplayListIfDirty(View.java:20718)
at android.view.View.draw(View.java:21585)
at android.view.ViewGroup.drawChild(ViewGroup.java:4546)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4321)
at android.view.View.draw(View.java:21862)
at com.android.internal.policy.DecorView.draw(DecorView.java:1083)
at android.view.View.updateDisplayListIfDirty(View.java:20732)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:725)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:731)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:840)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3909)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3683)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2991)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1850)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8455)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
据我从阅读该错误中了解到的,它是由于更改build.gradle文件中升级的软件和版本不匹配,所以这些是我的build.gradle文件:
Project:app-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url "http://jcenter.bintray.com"}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Module:app-
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.example.user.mahaluz"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
testImplementation 'junit:junit:4.12'
//google maps api
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
//Firebase
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation ("com.firebaseui:firebase-ui-database:2.1.1") {
exclude group: "com.android.support", module: "recyclerview-v7"
}
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-firestore:18.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
//Calendar
implementation 'com.github.alamkanak:android-week-view:1.2.6'
implementation 'com.github.sundeepk:compact-calendar-view:3.0.0'
implementation 'com.github.khacpv:Calendar-Day-View:1.0.5'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
//Image tools
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
//Validation
implementation 'com.basgeekball:awesome-validation:2.0'
//Notification badge
implementation 'com.nex3z:notification-badge:0.1.0'
//Others
implementation 'com.kevin:loopview:1.4.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
重要的一点是,该应用程序可以在我的登录活动中正常运行,并且在登录并随后到达活动之后,并在完成其onCreate()方法之后,会因上面的日志代码而崩溃。 任何帮助都将被申请:)