expo publish does not work in SDK 39

Please provide the following:

  1. SDK Version: 39 (managed workflow)
  2. Platforms(Android/iOS/web/all): iOS

Hi everyone! After updating SDK to 39, expo publish doesn’t work for me. I use the following React hook to check if there is an update.

import { useAppState } from '@react-native-community/hooks'
import { useEffect, useState, useRef } from 'react'
import * as Updates from 'expo-updates'
import { Platform } from 'react-native'

export const useExpoOta = () => {
  const [updating, setUpdating] = useState(false)
  const currentAppState: string = useAppState()
  const isUpdating = useRef(false)

  useEffect(() => {
    if (
      !__DEV__ &&
      currentAppState === 'active' &&
      Platform.OS !== 'web' &&
      !isUpdating.current
    ) {
      const update = async () => {
        try {
          const update = await Updates.checkForUpdateAsync();
          if (update?.isAvailable) {
            isUpdating.current = true
            setUpdating(true)
            await Updates.fetchUpdateAsync()
            await Updates.reloadAsync()
            setUpdating(false)
            isUpdating.current = false
          }
        } catch (e) {
          setUpdating(false)
          isUpdating.current = false
          console.error('👋 op, the expo update failed', e)
        }
      }
      update()
    }
  }, [currentAppState])

  return {
    updating,
  }
}

As the doc suggests, I import Updates from expo-updates.

I even built a new version, added it to TestFlight, and tried updating with the latest build but still did not update. Is there something I’m missing here or on my app.json?

Are you using release-channels, if so, it’s broken on SDK 39

https://github.com/expo/expo/issues/10304

4 Likes

The fix for the issue mentioned by @aryk has now been released:
https://github.com/expo/expo/issues/10464#issuecomment-703178030

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.