正如标题所示,我们正在努力使用应用程序中心中的正常管道来生成应用程序的工作发布版本。当我在本地使用发布标志通过命令行构建应用程序时,输出 APK 没有问题。
同样,当构建在应用程序中心上运行时,也没有任何迹象表明构建存在问题,除非安装并运行后,应用程序在启动屏幕后立即崩溃。
我们最近升级到了 gradle 7.3.3,因此必须为此升级到 JAVA 11,同样将环境密钥添加JAVA_HOME : $(JAVA_HOME_11_X64)到 App Center 上的环境变量中。
有人遇到过这种情况么。
最大的问题是,如果无法在本地生成的发布版本中复制此内容,我们就无法弄清楚如何调试问题,应用程序中心生成的发布版本没有任何错误日志记录。它悄无声息地崩溃了。
应用程序中心日志中唯一相关的部分如下所示。
编辑:为了让事情变得更有趣,我添加debuggable true到了 build.gradle 的发布配置中,并且该构建运行良好......不知道发生了什么巨大的变化
info Writing bundle output to:, /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /Users/runner/work/1/s/android/app/build/intermediates/sourcemaps/react/release/index.android.bundle.packager.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 201 asset files
info Done copying assets
/Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:3242:23: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow"
return typeof DebuggerInternal !== 'undefined' && DebuggerInternal.shouldPauseOnThrow === true;
^~~~~~~~~~~~~~~~
/Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:6950:7: warning: the …Run Code Online (Sandbox Code Playgroud) 我真的很难弄清楚我的问题出在哪里,我最近更改了很多代码,现在遇到了这个问题
ERROR Warning: React has detected a change in the order of Hooks called by Navigation. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks
Previous render Next render
------------------------------------------------------
1. useContext useContext
2. undefined useRef
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
in Navigation (at App.tsx:96)
in RCTView (at View.js:34)
in View (at createAnimatedComponent.js:217)
in AnimatedComponent (at createAnimatedComponent.js:278)
in AnimatedComponentWrapper (at createAnimatableComponent.js:599)
in withAnimatable(View) (at App.tsx:89)
in App (at mobile/index.js:28)
in HeadlessCheck (at renderApplication.js:47)
in …Run Code Online (Sandbox Code Playgroud)