Troubleshooting
Check Android SDK is loaded correctlyβ
You can use the Screeb.debug() command in your code.
You will get contextual information in the debugging log about the running user session:
βΉοΈ Output is printed with info log level.
Debug targeting rulesβ
Since the targeting engine built by Screeb runs in the background, you may not understand which rules prevent your survey from being displayed to a user.
You can use the Screeb.debugTargeting() command in your code.
You will get a list of available surveys and the associated targeting rules:
The rules with a green dot π’ are the ones that have been validated for this user. The rules with a red dot π΄ are not validated and may be the reason why your survey is not displayed.
βΉοΈ Output is printed with info log level.
Error casesβ
- An empty channel id means you didn't call the
initSdkmethod. - An empty respondent id means you exceeded your respondent quota.
SDK not initializingβ
If the SDK fails to initialize, check the following:
- Main thread initialization: Ensure
Screeb.initSdk()is called on the main/UI thread, typically in yourApplication.onCreate():
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Screeb.initSdk(this, "<YOUR-CHANNEL-ID>")
}
}
-
Channel ID: Verify your channel ID is correct. You can find it in the Screeb admin console.
-
Network permissions: Ensure your
AndroidManifest.xmlincludes internet permission:
<uses-permission android:name="android.permission.INTERNET" />
Survey or message not showingβ
If your survey isn't appearing when expected:
-
Targeting rules: Check targeting rules in the Screeb admin console. Use
Screeb.debugTargeting()to see which rules are failing. -
User identification: Ensure the user is identified before triggering a survey:
Screeb.setIdentity("user-123")
// Wait for identity to be set before expecting surveys
- Display hooks: If you use the
onSurveyDisplayAllowedhook, ensure it returnstruewhen the survey should be displayed:
Screeb.initSdk(
this,
channelId,
hooks = hashMapOf(
"version" to "1.0.0",
"onSurveyDisplayAllowed" to { _: Any -> true }
)
)
- Survey status: Confirm the survey is published and active in the Screeb admin console.
WebView not visible or blank widgetβ
If surveys appear blank or aren't visible:
-
Z-index conflicts: Check for overlapping views in your layout hierarchy. Ensure no views are covering the Screeb WebView.
-
Hardware acceleration: Enable hardware acceleration in your manifest (usually enabled by default):
<application
android:hardwareAccelerated="true"
...>
- WebView initialization: Ensure WebView is properly initialized. Check logcat for WebView errors:
adb logcat | grep -i "chromium\|webview"
High memory usageβ
If you notice increased memory consumption:
- Avoid multiple initializations: Only call
Screeb.initSdk()once, typically inApplication.onCreate():
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
// Initialize only once
if (!screebInitialized) {
Screeb.initSdk(this, channelId)
screebInitialized = true
}
}
companion object {
private var screebInitialized = false
}
}
- Clear resources: Call
Screeb.closeSdk()when appropriate, such as when the user logs out:
Screeb.closeSdk()
Crashes on app foreground/backgroundβ
Lifecycle-related crashes can occur if the SDK isn't properly initialized:
-
Initialize after Activity creation: Don't call
Screeb.initSdk()before the Activity is fully created. -
Handle lifecycle properly: Ensure your Application or Activity is handling lifecycle events correctly:
class MyActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Safe to use Screeb here
}
}
Anonymous users inflating MTU countβ
If you're seeing too many anonymous users:
- Call
Screeb.resetIdentity()on logout: Reset identity when users log out:
fun logout() {
Screeb.resetIdentity()
// Your logout logic
}
- Avoid init in test environments: Don't initialize Screeb in test or CI environments:
if (!BuildConfig.DEBUG && !isRunningTests()) {
Screeb.initSdk(this, channelId)
}
Missing ProGuard/R8 rulesβ
If you're using code minification (ProGuard or R8) and experiencing issues, add these keep rules to your proguard-rules.pro:
# Keep Screeb SDK classes
-keep class app.screeb.** { *; }
-keepclassmembers class app.screeb.** { *; }
# Keep WebView JavaScript interface
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
Build errors after adding Screebβ
If you encounter build errors:
-
Kotlin version: Ensure you're using a compatible Kotlin version (1.5.0 or higher).
-
Android SDK version: Minimum SDK version is 19 (Android 4.4 / API 19). Check your
build.gradle:
android {
defaultConfig {
minSdk 19
targetSdkVersion 33
...
}
}
- Dependency conflicts: Check for conflicting dependencies. Run:
./gradlew app:dependencies
- Clean and rebuild: Try cleaning your project:
./gradlew clean
./gradlew build