Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo-updates Issue: Empty String Returned from Updates.channel on Android #2188

Open
socheatleang opened this issue Jan 18, 2024 · 8 comments
Assignees
Labels
eas update needs review Issue is ready to be reviewed by a maintainer

Comments

@socheatleang
Copy link

Build/Submit details page URL

No response

Summary

I am encountering an issue with the expo-updates library in my Expo project specifically on Android. Despite configuring the project correctly, I am getting an empty string when trying to access the Updates.channel.

This issue happened after I did the migration from Expo Classic Updates

Managed or bare?

Managed

Environment

expo-env-info 1.0.5 environment info:
System:
OS: macOS 14.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 14.19.2 - ~/.nvm/versions/node/v14.19.2/bin/node
Yarn: 1.22.18 - /opt/homebrew/bin/yarn
npm: 6.14.17 - ~/.nvm/versions/node/v14.19.2/bin/npm
Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.14.3 - /opt/homebrew/bin/pod
SDKs:
Android SDK:
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.9971841
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
expo: ^48.0.0 => 48.0.21
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.71.8 => 0.71.8
react-native-web: ~0.18.7 => 0.18.12
npmGlobalPackages:
eas-cli: 6.0.0
expo-cli: 6.3.10
Expo Workflow: managed

Error output

No response

Reproducible demo or steps to reproduce from a blank project

eas.json

{
  "cli": {
    "version": ">= 0.48.2"
  },
  "build": {
    "development": {
      "channel": "development",
      "ios": { "image": "macos-ventura-13.3-xcode-14.3" },
      "android": { "image": "default", "buildType": "apk" }
    },
    "staging": {
      "channel": "staging",
      "ios": { "image": "macos-ventura-13.3-xcode-14.3" },
      "android": { "image": "stable" }
    },
}

command to build

eas build --profile staging

On the project. I fetch the channel by

import * as Updates from 'expo-updates';


console.log({
    channel: Updates.channel,
});

output

channel: ""

@socheatleang socheatleang added the needs review Issue is ready to be reviewed by a maintainer label Jan 18, 2024
@szdziedzic
Copy link
Member

Can you send me the URL of your build?

@socheatleang
Copy link
Author

@szdziedzic
Copy link
Member

OK, I see that the configure expo-updates step was executed successfully 🤔

Screenshot 2024-01-18 at 11 04 21

How do you launch your built app and inspect this channel value?

@socheatleang
Copy link
Author

import * as Updates from 'expo-updates';

console.log({
    channel: Updates.channel,
});

I get the channel by Updates.channel.

@socheatleang
Copy link
Author

I am on the

"expo-updates": "~0.16.4"

@socheatleang
Copy link
Author

@szdziedzic ? .

@quinlanj
Copy link
Member

quinlanj commented Jan 30, 2024

hey @socheatleang this is expected behaviour in the development client, though I understand the UX is jarring (sorry!). Your android app looks correctly configured though, so a normal build should have the Updates.channel show up.

Expo Go and development builds are not set to a specific channel and can run any updates compatible with their native runtime. Therefore, this value will always be null when running an update on Expo Go or a development build.

Doc details: https://docs.expo.dev/versions/latest/sdk/updates/#updateschannel

@quinlanj quinlanj self-assigned this Jan 30, 2024
@iNath
Copy link

iNath commented Feb 1, 2024

Same for me,

Updates.channel is alway null (or equivalent)

expo 49.0.22
expo-updates: 0.18.19

running eas build -p android --profile qualif-49-internal

part of my eas.json concerned:

  "build": {
    "qualif-49-internal": {
      "channel": "qualif-49",
      "android": {
        "buildType": "apk"
      }
    }
  }

Did I miss something or is it a bug ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eas update needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

4 participants