Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

Commit

Permalink
chore: better logging when shorebird.yaml is missing (#16)
Browse files Browse the repository at this point in the history
* fix: gracefully handle missing shorebird.yaml asset

* format

* more formatting

* revert changes to flutter_main.cc
  • Loading branch information
bryanoltman authored and Shorebird Autoroller committed Jun 5, 2023
1 parent 67499df commit 411cea5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
package io.flutter.embedding.engine;

import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.ColorSpace;
Expand Down Expand Up @@ -206,7 +206,8 @@ public void init(
String version = null;
long versionCode = 0;
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
PackageInfo packageInfo =
context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
version = packageInfo.versionName;
versionCode = packageInfo.getLongVersionCode();
} catch (PackageManager.NameNotFoundException e) {
Expand All @@ -225,6 +226,7 @@ public void init(
Log.w(TAG, "shorebird.yaml: " + shorebirdYaml);
} catch (IOException e) {
Log.e(TAG, "Failed to load shorebird.yaml", e);
Log.e(TAG, "Did you remember to include shorebird.yaml in your pubspec.yaml's assets?");
}

FlutterJNI.nativeInit(
Expand Down

0 comments on commit 411cea5

Please sign in to comment.