All Products
Search
Document Center

Application Real-Time Monitoring Service:Flutter FAQ

Last Updated:Dec 11, 2025

This topic answers frequently asked questions about Flutter Monitoring.

What should I do if my code depends on WidgetsFlutterBinding.ensureInitialized for initialization?

The software development kit (SDK) initialization method supports the beforeRunApp callback function. The beforeRunApp function is called before runApp. When you initialize AlibabaCloudRUM, you can pass the beforeRunApp function to run your business code. The following code provides an example:

AlibabaCloudRUM().start(
    MyApp(),
    beforeRunApp: () async =>
        {
          // Manually call WidgetsFlutterBinding.ensureInitialized().
          WidgetsFlutterBinding.ensureInitialized(), 
          await Dio().request("https://xxxxx.yyy/zzz")
        },
);

How do I resolve the error: resource android:attr/lStar not found. error when I compile for Android?

Upgrade the compile version of your Android project to 33 or higher. Follow these steps:

  1. Open the android/app/build.gradle file in your Flutter project.

  2. Find compileSdkVersion in the android closure.

  3. Change its value to 33 or higher.

If the issue persists, set the compileSdkVersion for all subprojects in the android/build.gradle file to 33 or higher, as shown in the following code:

// ... other configurations

subprojects {
    afterEvaluate { project ->
        if (project.plugins.hasPlugin("com.android.application") ||
                project.plugins.hasPlugin("com.android.library")) {
            project.android {
                compileSdkVersion 33 // Adjust this value as needed for your project. We recommend 33 or higher.
            }
        }
    }
}

// ... other configurations