Android应用程序启动时崩溃

Android应用程序启动时崩溃,android,android-studio,Android,Android Studio,这是错误(已将应用程序详细信息替换为空白)。我能够正确地部署apk,但当应用程序启动时,它会崩溃,出现以下错误 09-11 21:40:29.588 2819-2871/----- E/AndroidRuntime: FATAL EXCEPTION: IntentService[RegIntentService] Process:------, PID: 2819 java.lang.IncompatibleClassChangeError: The method 'java.io.Filean

这是错误(已将应用程序详细信息替换为空白)。我能够正确地部署apk,但当应用程序启动时,它会崩溃,出现以下错误

09-11 21:40:29.588 2819-2871/----- E/AndroidRuntime:
FATAL EXCEPTION: IntentService[RegIntentService]
Process:------, PID: 2819
java.lang.IncompatibleClassChangeError: The method 'java.io.Fileandroid.suppo
rt.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was
expected to be of type virtual but instead was found to be of type direct
(declaration of 'com.google.android.gms.iid.zzd' appears in
/data/app/<app_name>-1/base.apk)
at com.google.android.gms.iid.zzd.zzde(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.shopping.gcm.RegistrationIntentService.onHandleIntent(RegistrationInten
tService.java:65)
at
android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61) 09-11 21:40:30.444
2819-2870/-------- W/EGL_emulation: eglSurfaceAttrib not
implemented 09-11 21:40:30.444 2819-2870/-------
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7f205c1654c0,
error=EGL_SUCCESS 09-11 21:40:30.778 2819-2819/-------
I/Choreographer: Skipped 41 frames!  The application may be doing too much
work on its main thread. 09-11 21:40:30.840
2819-2870/------- E/Surface: getSlotFromBufferLocked:
unknown buffer: 0x7f205c1436c0 09-11 21:40:30.978
2819-2870/--------- E/Surface: getSlotFromBufferLocked:
unknown buffer: 0x7f205c142150 09-11 21:40:34.204
2819-2871/------- I/Process: Sending signal. PID: 2819 SIG:
9

关于如何解决这个问题有什么想法吗?

尝试使用最新的编译版本

例如: 编译'com.android.support:appcompat-v7:24.2.0'

也许ISSUE正在更新

一旦我遇到同样的问题,错误就被认出来了。。。这是因为MB中的资源
Heqvy无法加载,因此每次我编译和使用它时,应用程序都会崩溃。只需检查它是否有帮助

尝试使用最新的编译

例如: 编译'com.android.support:appcompat-v7:24.2.0'

也许ISSUE正在更新

一旦我遇到同样的问题,错误就被认出来了。。。这是因为MB中的资源
Heqvy无法加载,因此每次我编译和使用它时,应用程序都会崩溃。看看能不能帮上忙

我是新来的。我是否必须更改gradle文件中com.android.support*依赖项的所有版本,还是只更改appcompat?@pagarwal不要担心每个人在某个时候都是新手,是的,尝试更改所有依赖项并希望它对您有效,是的,尝试使用最新版本的android studio:)谢谢!非常欢迎你:)我是新来的。我是否必须更改gradle文件中com.android.support*依赖项的所有版本,还是只更改appcompat?@pagarwal不要担心每个人在某个时候都是新手,是的,尝试更改所有依赖项并希望它对您有效,是的,尝试使用最新版本的android studio:)谢谢!非常欢迎:)
apply plugin: 'com.android.application'
apply plugin: 'hugo'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'findbugs'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    repositories {
        mavenCentral()
    }
    defaultConfig {
        applicationId "------"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 22
        versionName "1.2.2"

    }
}
task findbugs(type: FindBugs) {
    ignoreFailures = false
    effort = "default"
    reportLevel = "medium"
    excludeFilter = new File("${project.rootDir}/findbugs/findbugs-filter.xml")
    classes = files("${project.rootDir}/app/build/intermediates/classes")
    source = fileTree('src/main/java/')
    classpath = files()
    reports {
        xml.enabled = true
        html.enabled = true
        xml {
            destination "$project.buildDir/findbugs/findbugs-output.xml"
        }
        html {
            destination "$project.buildDir/findbugs/findbugs-output.html"
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.android.support:support-v13:21.0.3'
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.android.support:palette-v7:21.0.3'
    compile 'com.android.support:recyclerview-v7:21.0.3'
    compile 'com.android.support:cardview-v7:21.0.3'
    compile 'com.jakewharton:butterknife:6.1.0'
    compile 'com.jakewharton.timber:timber:2.5.1'
    compile 'com.squareup.picasso:picasso:2.5.0'
    compile files('libs/commons-httpclient-3.1.jar')
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/httpclient-4.3.jar')
    compile 'info.hoang8f:fbutton:1.0.5'
    compile 'com.github.eluleci:flatui:3.0.0'
    compile files('libs/universal-image-loader-1.9.4.jar')
    compile 'com.google.android.gms:play-services-gcm:7.5.0'
    compile 'com.google.android.gms:play-services-analytics:7.5.0'
    compile 'com.android.support:design:22.2.0'
    compile 'com.vlonjatg.android:progress-activity:1.1.1'
    compile 'com.android.support:support-v4:+'
    compile 'com.squareup.picasso:picasso:2.3.2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.balysv.materialmenu:material-menu-toolbar:1.5.1'
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
    //    // Testing dependencies

    //    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'

    //    androidTestCompile 'com.android.support.test:runner:0.2'

    //    androidTestCompile 'com.android.support:support-annotations:22.1.1'
    compile files('libs/PGSDK_v1.0.jar')
}