Skip to content

fix: flask build application id mismatch #15070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

abretonc7s
Copy link
Contributor

Description

This PR resolves an issue where running yarn start:android:flask fails during installation with the error message:
"No development build (io.metamask) for this project is installed."

Root Cause

The problem occurs because Expo's installation process doesn't correctly handle the applicationIdSuffix in the Flask variant, causing it to look for "io.metamask" instead of "io.metamask.flask".

When using the standard Expo command npx expo run:android --variant 'flaskDebug', Expo incorrectly identifies the application's package name. This appears to be a limitation in how Expo's tooling interacts with Android product flavors and application ID suffixes.

Changes

  • Updated the buildAndroidRunFlask function in scripts/build.sh to bypass Expo's problematic installation process
  • Implemented a direct approach that builds, installs, and launches the app explicitly with the correct package name
  • Added clear guidance for developers to start the Metro server in a separate terminal

The implementation:

buildAndroidRunFlask(){
	prebuild_android
	# Add debug info
	echo "METAMASK_BUILD_TYPE: ${METAMASK_BUILD_TYPE}"
	echo "Running with Flask variant, which should use app ID: io.metamask.flask"
	
	# Build the debug app explicitly first to ensure we have the proper app ID
	cd android && ./gradlew assembleFlaskDebug --no-daemon && cd ..
	
	# Install the explicitly built APK with the correct package name
	adb install -r android/app/build/outputs/apk/flask/debug/app-flask-debug.apk
	
	# Launch the app
	echo "Launching app: io.metamask.flask"
	adb shell am start -n io.metamask.flask/io.metamask.MainActivity
	
	# Provide instructions for starting the development server
	echo ""
	echo "🚀 App installed and launched successfully!"
	echo "📱 Now start the Metro development server in a separate terminal with:"
	echo "    yarn watch"
	echo ""
}

Related issues

Fixes:

Manual testing steps

  1. Run yarn setup:flask
  2. Run yarn start:android:flask to build and install the app
  3. Verify the app installs successfully with package name "io.metamask.flask"
  4. Run yarn watch in a separate terminal to start the Metro server
  5. Confirm the app connects to the Metro server properly and hot reload works

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

github-actions bot commented May 2, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added team-sdk SDK team INVALID-PR-TEMPLATE PR's body doesn't match template labels May 2, 2025
@abretonc7s abretonc7s requested a review from andrepimenta May 2, 2025 08:22
@abretonc7s abretonc7s marked this pull request as ready for review May 2, 2025 08:22
@abretonc7s abretonc7s added No QA Needed Apply this label when your PR does not need any QA effort. No E2E Smoke Needed If the PR does not need E2E smoke test run labels May 2, 2025
Copy link

sonarqubecloud bot commented May 2, 2025

@abretonc7s abretonc7s added needs-smoke-e2e Run Smoke E2E Triggers smoke e2e on Bitrise and removed INVALID-PR-TEMPLATE PR's body doesn't match template No E2E Smoke Needed If the PR does not need E2E smoke test run labels May 2, 2025
Copy link
Contributor

github-actions bot commented May 2, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: a431960
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c1211362-487a-4933-b59b-cf6fb909cca6

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-smoke-e2e No QA Needed Apply this label when your PR does not need any QA effort. Run Smoke E2E Triggers smoke e2e on Bitrise team-sdk SDK team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants