Setting release channel for detached Android app


#1

Hi!

This question seems to have been answered before, but, to the best of my knowledge, the current answer doesn’t seem to line up with the files that actually show up in a detached project.

The Expo docs state that the release channel should be changed in Constants.java, but this file doesn’t exist in my detached project (SDK 28). My experience here seems to line up with comments in this forum post, and this GitHub issue. We don’t have a Constants.java file in main/java/host/exp/exponent. Instead, there’s an AppConstants.java file in main/java/host/exp/exponent/generated. This file does have a RELEASE_CHANNEL variable, but it also has some “embedded responses” code that appears to be autogenerated. I’m guessing this file is affected by the contents of MainActivity.java and is altered by the build process, so I’m not sure I really should be changing it.

Long-story short, looking for clarification as to what we’re actually supposed to change in an Android project in order to change the release channel. I don’t think it’s Constants.java, because none of us seem to have that file. Thanks!


#2

Bumping this because I’ve reached the point where I’m writing defensive code to account for the fact that I don’t really know what I’m supposed to be changing here :-).


#3

Hi @llamaluvr - sorry for the confusion here. AppConstants.java is the correct file to modify. I’m updating the docs accordingly right now.


#4

Thanks! If you could specify whether we’re supposed to do anything with those embeddedResponses variables, that’d be great, too.

Also curious if we need to change the publishedUrl in MainActivity.java. I forget where, but someone on an issue or stackoverflow mentioned changing MainActivity to include the release channel in the URL, like:

@Override
  public String publishedUrl() {
    return "exp://exp.host/@account/slug?release-channel=test";
  }

I originally did just this and didn’t even touch AppConstants, and it seemed like it actually worked as expected!


#5

@llamaluvr no, you should leave the embeddedResponses alone. And there shouldn’t be any need to include the release channel directly in the publishedUrl return value – just updating the value in AppConstants.java should do the trick.


closed #6

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