GithubHelp home page GithubHelp logo

java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' about androidfilepicker HOT 24 CLOSED

rosuh avatar rosuh commented on June 3, 2024
java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android'

from androidfilepicker.

Comments (24)

rosuH avatar rosuH commented on June 3, 2024

是在 demo 还是你自己的项目调用呢?

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

自己项目调用

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

@KuiYang2017 有没有加混淆呢?

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

之前没有,出现这个问题 . 我寻求方法 找到一个解决方案
`# ServiceLoader support
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {}
-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}

Most of volatile fields are updated with AFU and should not be mangled

-keepclassmembernames class kotlinx.** {
volatile ;`
但我的问题依然存在

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

加了下面的混淆吗?

-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {}
-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}

-keepclassmembernames class kotlinx.** {
    volatile <fields>;
}

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

是的 依然不行

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

是 Debug 模式就不行了吗?还是 release 包

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

release包不行

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

如果 release 包不行,那应该还是混淆的问题。我用 demo 打了 release 包,没有复现这个问题。
我再排查一下。

您上面说,以前不会,那是不是最近项目有所变动,升级了哪些依赖,或者启用了 R8 之类的呢?

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

是这样的 之前是直接安装的 现在是集成到一个叫awork的软件安装的,直接安装的没有问题,集成的有问题

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

我单独打包 集成进awork 也是报错,报这个错误

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

要确认一下:

  1. 集成的和直接安装的都是 release 包是吗?还是说直接安装的是 debug 版?
  2. aWork 是深信服的 aWork高级版安装工具 吗?
  3. 如果现在您直接安装,会不会报错?排除一下是不是 aWork 的影响。

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

1 都是
2 是
3 直接安装不会出错,,可以肯定是aWork的影响,
但是这个地方是程序出错了.我在想是不是aWork对app比较严格,直接把这个问题暴露出来了

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

因为我这里无法测试 aWork 的安装。你可以试试新建一个项目,里面只引入这个库并调用一下。
然后打个 release 包,安装看看有没有问题。

或者用我刚打包出来的 demo 也可以:

release.zip

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

我把demo打了个release 集成到aWork里了,还是有这个问题.
这个文件选择器能不能提供一个纯java环境的.

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

Demo 里没有加混淆的 😂...你把我打出来的那个装进去试试看?

此外,这个应该不是 Kotlin 的问题,可能是 aWork 的某些安全机制,对 协程库 的混淆有所影响。

我可以使用原生的线程实现现在的功能,但是需要一到两天的时间重写一下。

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

其实本身的app其实也没加混淆🤣

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

其实本身的app其实也没加混淆🤣

😮 你的 gradle 脚本里没有minifyEnabled true参数吗?

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

并没有 设置了false

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

你打的包 发给aWork封测人员,提示app可能已损坏

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

你打的包 发给aWork封测人员,提示app可能已损坏

...我对此完全无法发表任何看法,无知限制了我的想象力...😂

from androidfilepicker.

KuiYang2017 avatar KuiYang2017 commented on June 3, 2024

image
我们也不知道 为什么客户要用这个aWork

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

image
我们也不知道 为什么客户要用这个aWork

可能是限制系统和 APP 的功能。用于一些定制设备吧。

from androidfilepicker.

rosuH avatar rosuH commented on June 3, 2024

已在 0.5.2 中修复。

from androidfilepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.