【问题标题】:flutter build appbundle "can't find dynamically referenced class android.util.LongArray"颤振构建appbundle“找不到动态引用的类android.util.LongArray”
【发布时间】:2019-11-28 21:47:17
【问题描述】:

在我的 Flutter 应用程序中运行 flutter build appbundle 时,我的构建失败并出现以下错误:

Note: io.flutter.view.AccessibilityViewEmbedder$ReflectionAccessors: can't find dynamically referenced class android.util.LongArray
Note: there were 1 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.  
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)

我发现的最接近的就是issue

谁能指出我如何解决这个问题的正确方向?我可以以某种方式更新我的 android.jar 文件以包含 LongArray.java 文件吗?我应该找出引用LongArray 类的位置并尝试将其删除吗?

很难为这样的事情制作 MRE,但任何指针都会有所帮助。

(PS。我在 Linux 上使用 Android Studio 来开发应用程序。)

【问题讨论】:

    标签: android flutter flutter-dependencies


    【解决方案1】:

    在构建我的应用程序时,我遇到了同样的问题。 根据这篇 git 帖子,here 与 flutter.jar 相关。你只需要添加

    -dontwarn io.flutter.embedding.**
    

    到项目文件夹中的 /android/app/proguard-rules.pro 文件。

    这是因为flutter.jar没有带来AndroidX的依赖。

    更新:在 Flutter 1.9.1+hotfi.2 中出现了一个与 WindowInsets 相关的新错误。解决方法是在提到的文件中添加-dontwarn android.**。 信息:here

    【讨论】:

      猜你喜欢
      • 2023-03-23
      • 1970-01-01
      • 2021-04-14
      • 1970-01-01
      • 1970-01-01
      • 2021-04-11
      • 2020-08-06
      • 2019-06-02
      • 2020-11-15
      相关资源
      最近更新 更多