mirror of
https://github.com/bitwarden/android.git
synced 2026-04-11 01:51:18 -05:00
1.7 KiB
1.7 KiB
Troubleshooting
Common Issues
Build fails with SDK dependency error
Problem: Cannot resolve Bitwarden SDK from GitHub Packages
Solution:
- Ensure
GITHUB_TOKENis set inuser.propertiesor environment - Verify token has
read:packagesscope - Check network connectivity to
maven.pkg.github.com
Tests fail with dispatcher issues
Problem: Tests hang or fail with "Module with Main dispatcher had failed to initialize"
Solution:
- Extend
BaseViewModelTestfor ViewModel tests - Use
@RegisterExtension val mainDispatcherExtension = MainDispatcherExtension() - Ensure
runTest { }wraps test body
Compose preview not rendering
Problem: @Preview functions show "Rendering problem"
Solution:
- Check for missing theme wrapper:
BitwardenTheme { YourComposable() } - Verify no ViewModel dependency in preview (use state-based preview)
- Clean and rebuild project
ProGuard/R8 stripping required classes
Problem: Release build crashes with missing class errors
Solution:
- Add keep rules to
proguard-rules.pro - Check
consumer-rules.proin library modules - Verify kotlinx.serialization rules are present
App module test flavor errors
Problem: ./gradlew app:testDebugUnitTest fails or runs no tests
Solution: The app module uses build flavors. Use testStandardDebugUnitTest:
./gradlew app:testStandardDebugUnitTest
Debug Tips
- Timber Logging: Enabled in debug builds, check Logcat with tag filter
- Debug Menu: Available in debug builds via Settings > About > Debug Menu
- Network Inspector: Use Android Studio Network Profiler or Charles Proxy
- SDK Debugging: Check
BaseSdkSourcefor wrapped exceptions