Skip to content

Conversation

@LukasMod
Copy link

@LukasMod LukasMod commented Nov 14, 2025

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 getAppName

function getAppName(sourceDir: string, userConfigAppName: string | undefined) {
  let appName = '';
  if (
    typeof userConfigAppName === 'string' &&
    fs.existsSync(path.join(sourceDir, userConfigAppName))
  ) {
    appName = userConfigAppName;
  } else if (fs.existsSync(path.join(sourceDir, 'app'))) {
    appName = 'app';
  }
  return appName;
}

Test Plan

New unit tests included


Note

Add fallback to locate APK/AAB outputs when appName is missing, export the helper, and add unit tests.

  • Android runAndroid:
    • Output file discovery (findOutputFile.ts):
      • Export getInstallOutputFileName and import readdirSync.
      • Add fallback to scan buildDirectory for files ending with -<variant>.<apk|aab> when appName is empty.
      • Retains CPU-specific and default filename checks.
  • Tests:
    • Add __tests__/getInstallOutputFileName.test.ts covering CPU-specific, appName-present, and missing-appName cases.

Written by Cursor Bugbot for commit 2186199. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Nov 14, 2025

@LukasMod is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant