[英]Why is TestFlight app different from local development?
I have a React Native app with a custom native plugin.我有一个带有自定义本机插件的 React Native 应用程序。
The app works fine when I test it with Xcode on my device.当我在我的设备上使用 Xcode 测试该应用程序时,它运行良好。
I uploaded the exact same app to the App Store and it got broken.我将完全相同的应用程序上传到 App Store,但它被破坏了。
On my iPhone it doesn't actually start and on my iPad it is buggy:在我的 iPhone 上它实际上并没有启动,而在我的 iPad 上它是错误的:
Unfortunately, I can't debug the TestFlight App.不幸的是,我无法调试 TestFlight 应用程序。
Does someone have a starting point why this could happen?有人知道为什么会发生这种情况吗?
I found the problem.我发现了问题。 It was in my Plugin and how I expose it.它在我的插件中以及我如何公开它。 My index.ts
file looked like this:我的index.ts
文件如下所示:
import { NativeModules } from 'react-native';
const { MyPlugin } = NativeModules;
export default MyPlugin;
Better with no default export:没有默认导出更好:
import { NativeModules } from 'react-native';
export const { MyPlugin } = NativeModules;
I don't know why a default export doesn't work in release mode.我不知道为什么默认导出在发布模式下不起作用。 I tried all release flags to be the same as default, but it was the same result.我尝试将所有发布标志都与默认值相同,但结果相同。 So, just changing the way of export was fixing it.所以,只是改变出口方式就是解决它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.