All Products
Search
Document Center

Cloud Monitor:Flutter FAQ

Last Updated:Dec 23, 2025

This topic answers common questions about Flutter Monitoring.

How do I handle initialization dependencies on WidgetsFlutterBinding.ensureInitialized in my business code?

The SDK initialization method accepts a beforeRunApp callback function. The beforeRunApp function is invoked before runApp. You can pass beforeRunApp during AlibabaCloudRUM initialization to run your business code. For 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 compiling for Android?

Upgrade the compileSdkVersion 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 the value to 33 or higher.

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

// ... 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. A value of 33 or higher is recommended.
            }
        }
    }
}

// ... other configurations