Troubleshooting
Resolve common Android SDK integration issues and errors
Troubleshooting
This guide covers the most common issues developers encounter when integrating StreamLayer into Android applications.
SDK Not Initializing
Symptoms:
StreamLayer.initialize()throws exception- Initialization succeeds but StreamLayer features unavailable
- LogCat shows "Missing API key" warnings
Solution:
- Verify API key is set via
StreamLayer.initialize(context, apiKey) - Ensure initialization happens in your custom Application class
onCreate() - Confirm Application class is registered in AndroidManifest.xml:
android:name=".YourApplication" - Initialize StreamLayer before creating any StreamLayer UI elements
- Check that context passed is the application context, not null
StreamLayer Element Not Appearing
Symptoms:
- StreamLayerView renders blank
- View is added but shows nothing
- Layout preview shows content but runtime is empty
Solution:
- Verify parent Fragment is in RESUMED state—StreamLayer needs active lifecycle
- Check LayoutInflater is using correct Fragment context, not Activity context
- Ensure StreamLayerView has explicit dimensions in XML or layout params
- Add margin/padding to verify view is actually rendering (not positioned off-screen)
- Test in portrait and landscape—rotation may cause visibility issues
ProGuard/R8 Obfuscation Issues
Symptoms:
- App crashes with "method not found" after building release APK
- NoSuchMethodError for StreamLayer methods
- Works in debug, fails in release builds
Solution:
- Add to
proguard-rules.pro:-keep class com.streamlayer.** { *; } -keep interface com.streamlayer.** { *; } -keep enum com.streamlayer.** { *; } - Also preserve native methods:
-keepclasseswithmembernames class * { native <methods>; } - Test release build on physical device before publishing
- Review ProGuard mapping file if crashes occur—check method names
- Disable minification temporarily to isolate ProGuard-specific issues
Dependency Conflicts
Symptoms:
- Gradle sync fails with "Duplicate class" error
- AndroidX library version conflicts
- Media3 transitive dependency issues
Solution:
- Check for duplicate dependencies using
./gradlew dependencies - Force compatible versions in your
build.gradle:implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.media3:media3-common:1.1.1' - Review StreamLayer's dependencies—they're compatible with AndroidX
- Use version alignment:
com.google.android.material:materialshould match AndroidX versions - Run
./gradlew clean buildafter dependency changes
Build Errors
Symptoms:
- Gradle sync fails mysteriously
- "Unable to resolve dependency" errors
- Minimum SDK version mismatch messages
Solution:
- Verify minimum SDK is API 21 or higher—StreamLayer requires API 21+
- Update Gradle:
./gradlew wrapper --gradle-version 8.0(or latest) - Check Android Gradle Plugin version (4.2+ recommended)
- Clear Gradle cache:
rm -rf ~/.gradle/caches/ - Run
./gradlew clean buildafter clearing cache - Verify JDK version: use JDK 11+ for Gradle 7.0+
Still Need Help?
If you've tried these solutions and still encounter issues, contact our support team at [email protected] with:
- Full Gradle error logs from
./gradlew buildoutput - Android OS version and device info
- AGP version and Gradle version used
Related
- Integration Guide — Full Android SDK setup and configuration
- Getting Started — Android SDK overview and quick-start path
Updated 21 days ago
