【问题标题】:Apps hangs on Marshmallow应用程序挂在棉花糖上
【发布时间】:2016-07-12 07:22:55
【问题描述】:

我的 Android 应用在 Lollipop 上运行良好。但它挂在棉花糖里。

当我打开应用程序时,返回主页按钮,再次打开应用程序。它挂起。我用过所有这些库:

compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.google.android.gms:play-services-analytics:9.0.2'
compile "com.google.android.gms:play-services:9.0.2"
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.android.support:multidex:1.0.0'

我使用:

 compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.appid"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        dexOptions {
            incremental true
            javaMaxHeapSize "4g"
        }
    }

【问题讨论】:

  • 如果没有实现RuntimePermission,设置targetSdkVersion 22

标签: android android-6.0-marshmallow


【解决方案1】:

你得到什么异常时间?

检查您是否请求以下任何权限:https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous

如果你是,那么你必须使用requestPermissions专门请求他们

【讨论】:

    【解决方案2】:

    我找到了解决方案。 我刚刚将库更新为最新的库,即 compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.1' compile 'com.android.support:design:23.2.1' compile 'com.android.support:support-v4:23.2.1' compile 'com.android.support:recyclerview-v7:23.2.1' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4' compile 'com.mcxiaoke.volley:library:1.0.1' compile 'com.google.android.gms:play-services-analytics:9.2.0' compile "com.google.android.gms:play-services:9.2.0" compile 'com.google.firebase:firebase-messaging:9.0.2' compile 'com.android.support:multidex:1.0.1'

    由于我没有使用危险权限,我不需要在运行时处理。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-08
      • 1970-01-01
      • 1970-01-01
      • 2017-02-02
      • 1970-01-01
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      相关资源
      最近更新 更多