fix: case for missing appName in getInstallOutputFileName #628
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Add a fallback to locate APK/AAB files with missing app names after the build process. This is needed for scenarios where Android hybrid apps do not follow the default structure like
android/app.Backgound:
The GitHub Action upload uploads the entire folder, unlike providerS3 which targets a specific file. Reference: action.yml#L298
If the build output names do not match expectations, outputFilePath is not generated and becomes undefined. As a result, the cache is not saved and the upload fails with
ENOENT: no such file or directory.This mismatch can happen when the Android folder does not follow the default structure.
AppName comes from https://github.com/react-native-community/cli/blob/main/packages/cli-config-android/src/config/index.ts Hybrid app may not have a subfolder, so an empty string is returned from
getAppNameTest Plan
New unit tests included
Note
Add fallback to locate APK/AAB outputs when appName is missing, export the helper, and add unit tests.
findOutputFile.ts):getInstallOutputFileNameand importreaddirSync.buildDirectoryfor files ending with-<variant>.<apk|aab>whenappNameis empty.__tests__/getInstallOutputFileName.test.tscovering CPU-specific, appName-present, and missing-appName cases.Written by Cursor Bugbot for commit 2186199. This will update automatically on new commits. Configure here.