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

Conversation

@jiahaog
Copy link
Member

@jiahaog jiahaog commented Jun 30, 2021

When the manifest file doesn't specify io.flutter.embedding.android.SplashScreenDrawable and FlutterFragmentActivity is used, the app crashes with a android.content.res.Resources$NotFoundException: Resource ID #0x0 exception.

This should have been part of #13660.

  • Fix the splash screen tests in FlutterFragmentActivityTest as well – they should have been instantiating a FlutterFragmentActivity instead of FlutterActivity.

Related Issue

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@google-cla google-cla bot added the cla: yes label Jun 30, 2021
@jiahaog jiahaog force-pushed the jiahaog-patch-1-1 branch 2 times, most recently from c2e4e28 to ba3792e Compare July 16, 2021 00:41
@jiahaog jiahaog marked this pull request as ready for review July 16, 2021 01:56
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@jiahaog
Copy link
Member Author

jiahaog commented Jul 16, 2021

@blasten any thoughts on how this should be tested? Seems like flutter/flutter#44242 was filed previously for the tests when #13660 was created.

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change LG, but could we add a test?

@jiahaog jiahaog force-pushed the jiahaog-patch-1-1 branch from ba3792e to 95cff24 Compare July 27, 2021 07:35
@jiahaog
Copy link
Member Author

jiahaog commented Jul 27, 2021

@blasten sorry for the delay, I have added the tests

@jiahaog jiahaog requested a review from blasten July 27, 2021 08:37
}

@Test
public void itWithMetadataWithoutSplashScreenResourceDoesNotLoadsSplashScreenDrawable()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this test name correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More or less, it has the metadata file but does not have the lines

activityInfo.metaData.putInt(
        FlutterActivityLaunchConfigs.SPLASH_SCREEN_META_DATA_KEY,
        SplashShadowResources.THEMED_SPLASH_DRAWABLE_ID);

to put the <meta-data> entry. Updated it to make it a bit clearer though.

}

@Test
public void itWithMetadataWithoutSplashScreenResourceDoesNotLoadsSplashScreenDrawable()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM + comment about test name

@jiahaog jiahaog added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jul 29, 2021
@fluttergithubbot fluttergithubbot merged commit 4045145 into flutter:master Jul 29, 2021
@jiahaog jiahaog deleted the jiahaog-patch-1-1 branch July 29, 2021 03:12
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 29, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 29, 2021
naudzghebre pushed a commit to naudzghebre/engine that referenced this pull request Sep 2, 2021
filmil pushed a commit to filmil/engine that referenced this pull request Apr 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes needs tests platform-android waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add framework test for splash screen lookup/loading

3 participants