Why did publishing to Google Play fail with “Package not found” when using Codemagic?
Last updated: December 17, 2025
Context
You attempted to publish an Android App Bundle (AAB) to the Google Play internal testing track via Codemagic, but the build failed with an error similar to: Publishing App Bundle to track ‘internal’ failed. Package not found: com.example.app. You’re trying to understand why this happens and how to successfully publish.
Answer
This error occurs when Google Play can’t find an existing app with the specified package name (applicationId) in your Play Console account. For brand-new apps, Google requires the very first binary to be uploaded manually via the Play Console. After that initial manual upload, Codemagic can publish subsequent builds automatically.
Create the app in Google Play Console:
Go to Google Play Console and click “Create app.”
Enter the app details and ensure the package name matches your app’s applicationId (e.g., com.example.app).
Complete the initial setup steps and declarations as required by Google.
Manually upload the first release:
Navigate to “Internal testing” (or “Production,” if preferred).
Upload your AAB file manually (you can download the AAB artifact from your Codemagic build if needed).
Re-run your Codemagic build with publishing enabled. It should now succeed.