简体   繁体   English

为什么 TestFlight 应用与本地开发不同?

[英]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 上它是错误的:

  • I have to tap buttons twice我必须按两次按钮
  • Code order is wrong (may threading / rendering)代码顺序错误(可能线程/渲染)
  • Events from the plugin sometimes get fired and sometimes not.插件中的事件有时会被触发,有时不会。 Totally random.完全随机。 (could also be rendering issue) (也可能是渲染问题)

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.

相关问题 为什么应用程序在上传后从 testflight 的 Build 部分中删除 - Why the app is removed from the Build section in testflight after it is uploaded 从TestFlight应用下载行为 - Downloading from TestFlight app behavior 通过TestFlight加载时的iOS应用程序不同 - IOS app different when loading via TestFlight Apple协会文件已在开发中获取,但未在TestFlight和App Store中获取 - Apple association file fetched in development but not in TestFlight and App Store 直接从Xcode和UITextView组件中的TestFlight直接安装的应用程序的不同行为 - Different behavior of app installed directly from Xcode and from TestFlight in UITextView component 为什么从Testflight运行时此应用程序崩溃100%,也许从Xcode崩溃10% - Why would this app crash 100% when running from Testflight, maybe 10% from Xcode 从开发切换到生产后,TestFlight期间的CloudKit数据 - CloudKit data during TestFlight once switching from development to production iOS企业开发 - TestFlight - iOS Enterprise Development - TestFlight TestFlight的开发和生产 - TestFlight development and production 应用程序在TestFlight的每次首次启动时崩溃 - App crashing in every first launch from TestFlight
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM