更新Expo SDK至51,App(iOS)仅在生产模式下卡在闪屏

问题描述 投票:0回答:1

我刚刚将我的 Expo 应用程序(托管工作流程)从 SDK49 更新到了 51。使用 SDK49,它工作正常,但是,更新后,应用程序卡在启动屏幕上。该问题仅出现在生产模式(在 Testflight 中)。这是使用 iOS,我目前只是在生产 iOS 中进行编码。

这是我的依赖项:

"dependencies": {
    "@apollo/client": "^3.10.4",
    "@expo/vector-icons": "^14.0.2",
    "@react-native-async-storage/async-storage": "^1.23.1",
    "@react-navigation/bottom-tabs": "^6.5.20",
    "@react-navigation/native": "^6.1.17",
    "@react-navigation/stack": "^6.3.29",
    "@stripe/stripe-react-native": "0.37.2",
    "axios": "^1.5.1",
    "expo": "^51.0.11",
    "expo-apple-authentication": "^6.4.1",
    "expo-asset": "^10.0.8",
    "expo-auth-session": "^5.5.2",
    "expo-av": "^14.0.5",
    "expo-crypto": "^13.0.2",
    "expo-dev-client": "^4.0.15",
    "expo-device": "^6.0.2",
    "expo-font": "^12.0.7",
    "expo-haptics": "^13.0.1",
    "expo-image-manipulator": "^12.0.5",
    "expo-image-picker": "^15.0.5",
    "expo-linking": "^6.3.1",
    "expo-location": "^17.0.1",
    "expo-notifications": "^0.28.7",
    "expo-random": "^14.0.1",
    "expo-secure-store": "^13.0.1",
    "expo-splash-screen": "^0.27.5",
    "expo-updates": "^0.25.16",
    "expo-web-browser": "^13.0.3",
    "geolib": "^3.3.4",
    "graphql": "^15.8.0",
    "graphql-request": "^6.1.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-is": "^18.2.0",
    "react-native": "0.74.2",
    "react-native-gesture-handler": "^2.16.2",
    "react-native-get-random-values": "^1.11.0",
    "react-native-maps": "1.14.0",
    "react-native-modal": "^13.0.1",
    "react-native-particles": "^0.0.8",
    "react-native-progress": "^5.0.1",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "react-native-svg": "15.2.0",
    "react-native-web": "^0.19.12",
    "react-native-webview": "13.8.6",
    "react-redux": "^9.1.2",
    "redux": "^5.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0"
  },
  "private": true
}

和我的 App.js:

export default function App(props) {

  const [isReady, setIsReady] = React.useState(false);
  const [publishableKey, setPublishableKey] = React.useState(null);

  const LoadFonts = async () => {
    await useFonts();
  };
 
  React.useEffect(() => {
    try{
      LoadFonts().then(() => {
          GetPublishableKey().then(res => {
            if (res.data && res.data.publishableKey){
                setPublishableKey(res.data.publishableKey)
                setIsReady(true)
            }
          })
          .catch(err => console.log(err))
          
      })
    }
    catch(err){
      setIsReady(true)
    }
  }, [])

  React.useEffect(() => {
    if (isReady) {
      SplashScreen.hideAsync();
    }
  }, [isReady]);

  if (!isReady) {
    return null;
  }

  // Define your HTTP link including the headers
  const httpLink = new HttpLink({
    uri: ' my GraphQL API endpoint',
    headers: {
       // here are my headers
    },
  });

  const client = new ApolloClient({
    link: from([httpLink]),
    cache: new InMemoryCache(),
  });

  return (
    <ApolloProvider client={client}>
      <Provider store={store}>
        <StripeProvider publishableKey={publishableKey}>
          <Connection />
        </StripeProvider>
      </Provider>
    </ApolloProvider>
  );
  
};

当我运行:npx expo-doctor@latest, 我得到:没有发现该项目有任何问题!

我还尝试删除node_modules并运行npm install,但没有任何效果..

这个错误特别烦人,因为我必须重做构建来检查可能的解决方案是否有效......

有人知道哪个依赖项/代码的一部分在生产过程中破坏了代码吗? 谢谢, 雨果

react-native expo
1个回答
0
投票

我也有同样的问题,你找到解决办法了吗??

© www.soinside.com 2019 - 2024. All rights reserved.