Skip to content

Commit

Permalink
[expo-updates] improve error messaging in the case where an app is bu…
Browse files Browse the repository at this point in the history
…ilt without having run expo publish
  • Loading branch information
esamelson committed Mar 17, 2020
1 parent 5b1f4c2 commit 774e642
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public synchronized void start(final Context context) {
}

if (mUpdatesConfiguration.getUpdateUrl() == null) {
throw new AssertionError("expo-updates is enabled, but no valid updateUrl is configured. Please set a valid URL in AndroidManifest.xml or when initializing UpdatesController.");
throw new AssertionError("expo-updates is enabled, but no valid updateUrl is configured in AndroidManifest.xml. If you are making a release build for the first time, make sure you have run `expo publish` at least once.");
}

boolean shouldCheckForUpdate = UpdatesUtils.shouldCheckForUpdateOnLaunch(mUpdatesConfiguration, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static Manifest readEmbeddedManifest(Context context) {
sEmbeddedManifest = ManifestFactory.getManifest(context, new JSONObject(manifestString));
} catch (Exception e) {
Log.e(TAG, "Could not read embedded manifest", e);
throw new AssertionError("The embedded manifest is invalid or could not be read. If you are making a release build for the first time, make sure you have run `expo publish` at least once.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ + (nullable EXUpdatesUpdate *)embeddedManifest
} else {
NSAssert([manifest isKindOfClass:[NSDictionary class]], @"embedded manifest should be a valid JSON file");
embeddedManifest = [EXUpdatesUpdate updateWithManifest:(NSDictionary *)manifest];
if (!embeddedManifest.updateId) {
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:@"The embedded manifest is invalid. If you are making a release build for the first time, make sure you have run `expo publish` at least once."
userInfo:@{}];
}
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ - (void)start

if (!EXUpdatesConfig.sharedInstance.updateUrl) {
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:@"expo-updates is enabled, but no valid URL is configured under EXUpdatesURL."
reason:@"expo-updates is enabled, but no valid URL is configured under EXUpdatesURL. If you are making a release build for the first time, make sure you have run `expo publish` at least once."
userInfo:@{}];
}

Expand Down

0 comments on commit 774e642

Please sign in to comment.