SDKsFlutter
Troubleshooting
Common issues and solutions for the Adopture Flutter SDK.
No Events Appearing in Dashboard
- Enable debug mode to see SDK activity in the console:
await Adopture.init(appKey: 'ak_...', debug: true); - Check the console output for error messages prefixed with
[Adopture]. - Verify your app key is correct. It should follow the format
ak_followed by 24 characters. - Ensure the device has network connectivity.
- Check the Realtime tab in your dashboard. Events may take a few seconds to appear.
Events Are Delayed
By default, events are batched and sent every 30 seconds or when 20 events are queued. This is by design to reduce network usage.
- Use debug mode for immediate sending during development.
- Call
await Adopture.flush()to force-send all queued events immediately.
Rate Limit Errors
If you see rate limit errors in the console:
- Check your plan's per-minute event limit on the Billing page.
- The SDK automatically retries with exponential backoff when rate limited.
- In debug mode, frequent tracking calls may trigger rate limits more easily since events are sent immediately.
SDK Not Initialized
All SDK methods require initialization first. If you see "SDK not initialized" errors:
- Always call
await Adopture.init(...)before any other SDK method. - Call it in your
main()function beforerunApp(). - Verify initialization status:
bool ready = Adopture.isInitialized;Opt-Out and Disable Tracking
To stop all tracking and clear the event queue (for example, when a user opts out):
await Adopture.disable(); // Stops all tracking, clears queueTo re-enable tracking:
Adopture.enable(); // Re-enables trackingCheck SDK State
Use these properties to inspect the current state of the SDK:
print('Initialized: ${Adopture.isInitialized}');
print('Enabled: ${Adopture.isEnabled}');
print('Queue: ${Adopture.queueLength} events');
print('Session: ${Adopture.sessionId}');