【问题标题】:App close when image selected from gallery AviaryIntent.Builder(this) in 7.0在 7.0 中从图库 AviaryIntent.Builder(this) 中选择图像时应用关闭
【发布时间】:2017-08-22 02:35:05
【问题描述】:

我正在尝试在 AviaryIntent.Builder 的帮助下编辑图像 它在 6.0 之前工作正常,但在 7.0 中应用程序崩溃

 Intent newIntent = new AviaryIntent.Builder(this)
                    .setData(Uri.parse(photoItem.getFilePath()))
                    .withOutput(Uri.fromFile(mEditingPhotoFile))
                    .saveWithNoChanges(false)
                    .withOutputFormat(Bitmap.CompressFormat.JPEG)
                    .withOutputSize(MegaPixels.Mp30)
                    .withOutputQuality(100)
                    .withVibrationEnabled(true)
                    .build();

            startActivityForResult(newIntent, REQUEST_EDIT_PHOTO);
            overridePendingTransition(R.anim.modal_activity_open_enter, R.anim.modal_activity_open_exit);

它正在崩溃 startActivityForResult(newIntent, REQUEST_EDIT_PHOTO);

【问题讨论】:

  • 崩溃日志或堆栈跟踪会有所帮助。
  • 应用程序只需关闭并在 android 监视器中没有错误,而不是在运行中

标签: android


【解决方案1】:

查看此链接https://developer.android.com/about/versions/nougat/android-7.0-changes.html#ndk

它解释了为什么会发生崩溃!另外我认为您使用的 Aviary 库引用了 7.0 中不允许的平台库(在上面的链接中提到)。

您可以按照链接中的说明在 build.gradle 文件中减少 targetSdkVersion

编辑:看看这个Adobe creative SDK not working for Android Nougat

【讨论】:

    【解决方案2】:

    Android 6.0 及以上需要运行时权限 参考https://developer.android.com/training/permissions/requesting.html

    【讨论】:

    • 我已集成运行时权限
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-29
    • 2017-01-11
    相关资源
    最近更新 更多