TWA Troubleshooting
Common issues and solutions when building TWA apps.
Build Issues
"JDK not found"
Error:
Error: JDK not foundSolution:
# Let Bubblewrap install JDK
bubblewrap doctor
# Or set JAVA_HOME manually
export JAVA_HOME=/path/to/jdk17macOS with Homebrew:
export JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home"Android SDK not found"
Error:
Error: Android SDK not foundSolution:
# Let Bubblewrap install SDK
bubblewrap doctor
# Or set ANDROID_HOME
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools"Manifest not found"
Error:
Error: Could not fetch manifest from https://...Solution:
- Verify URL is correct and accessible
- Check manifest.json returns valid JSON
- Ensure HTTPS is working
- Try
curl https://your-domain.com/manifest.json
Build Hangs
Issue: Build process stops responding
Solution:
# Kill and retry
pkill -f bubblewrap
bubblewrap build
# Or skip validation
bubblewrap build --skipPwaValidationRuntime Issues
URL Bar Showing
Cause: Digital Asset Links not configured
Solutions:
Verify
assetlinks.jsonis accessible:bashcurl https://your-domain.com/.well-known/assetlinks.jsonCheck package name matches exactly
Verify SHA256 fingerprint:
bashkeytool -list -v -keystore android.keystore | grep SHA256Clear Chrome cache on device: Settings → Apps → Chrome → Storage → Clear Data
Reinstall the TWA app
White Screen on Launch
Causes:
- PWA not loading
- JavaScript errors
- Network issues
Solutions:
- Check PWA loads in browser first
- Verify start_url in manifest.json
- Check for console errors (connect to Chrome DevTools)
- Ensure HTTPS certificate is valid
App Crashes Immediately
Causes:
- Package name mismatch
- Missing permissions
- Chrome not installed
Solutions:
- Verify package name in manifest matches build
- Check Android logs:bash
adb logcat | grep -i crash - Ensure Chrome is installed on device
MWA Not Working
Causes:
- Chrome not the active browser
- Wallet not installed
- Network issues
Solutions:
- Verify Chrome preference is working (check logs)
- Install a Solana wallet (Phantom, Solflare)
- Test MWA in regular Chrome first
Splash Screen Issues
Symptom: Splash shows forever / doesn't fade
Solutions:
- Check
splashScreenFadeOutDurationin twa-manifest.json - Verify PWA loads correctly
- Check for JavaScript errors preventing load complete
Keystore Issues
Lost Keystore Password
Bad news: Can't recover. Create new keystore.
Prevention:
- Store password in password manager
- Keep backup in secure location
- Document passwords securely
Can't Update App
Cause: Different signing key than original
Solution: Must release as new app with new package ID
Keystore Corrupted
Solution:
# Verify keystore
keytool -list -v -keystore android.keystore
# If corrupted, create new
keytool -genkeypair -alias android -keyalg RSA -keysize 2048 -validity 10000 -keystore android.keystoreInstallation Issues
"App not installed"
Causes:
- Signature mismatch (different key)
- Insufficient storage
- Incompatible Android version
Solutions:
- Uninstall existing app first
- Check device storage
- Verify minSdkVersion (24 = Android 7.0)
Can't Install via ADB
# Check device connected
adb devices
# Force install
adb install -r app-release-signed.apk
# Clear existing
adb uninstall com.yourpackage.name
adb install app-release-signed.apkDebugging
Chrome Remote Debugging
- Enable USB debugging on device
- Open Chrome on desktop
- Navigate to
chrome://inspect - Find your TWA under "Remote Target"
- Click "Inspect"
ADB Logs
# All logs
adb logcat
# Filter by tag
adb logcat -s CustomLauncherActivity
# Filter by app
adb logcat --pid=$(adb shell pidof com.solanapwa.template)Network Debugging
# Check connectivity from device
adb shell ping your-domain.com
# Check Chrome's network
# In Chrome DevTools → Network tabPerformance Issues
Slow Initial Load
Solutions:
- Optimize PWA bundle size
- Implement service worker caching
- Use code splitting
- Preload critical resources
High Memory Usage
Solutions:
- Profile with Chrome DevTools
- Check for memory leaks
- Optimize images
- Lazy load heavy components
Getting Help
Check Bubblewrap issues: GitHub Issues
Solana Mobile Discord: Community support
Chrome TWA docs: developer.chrome.com
Template issues: GitHub