Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[stable] disable vivante from using impeller gles/vulkan #170132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

rekire
Copy link
Contributor

@rekire rekire commented Jun 6, 2025

My first cherry pick, I want to see this vivante fix (#169760) on stable to avoid disabling impeller for devices with a vivante graphics chip.

Impacted Users

I have no exact numbers but such Android devices with a vivante graphics chip

Impact Description

The app crashes on startup. See the issue #167850 for details

Workaround

Option 1: Disable impeller

Disable impeller by adding this to the AndroidManifest.xml, as explained in the documentation.

<meta-data
    android:name="io.flutter.embedding.android.EnableImpeller"
    android:value="false" />

Option 2: Just for that chip

Add this to your MainActivitiy:

class MainActivity : FlutterFragmentActivity() {
    // ...
    override fun provideFlutterEngine(context: Context): FlutterEngine? =
        FlutterEngine(applicationContext, arrayOf("--enable-impeller=$useImpeller"))

    private val useImpeller: Boolean; get() {
        val eglHardware = getSystemProperty("ro.hardware.egl")
        return !eglHardware.equals("VIVANTE", ignoreCase = true)
    }

    @Suppress("SameParameterValue")
    @SuppressLint("PrivateApi")
    private fun getSystemProperty(name: String): String? = try {
        val systemProperties = Class.forName("android.os.SystemProperties")
        val getMethod = systemProperties.getMethod("get", String::class.java)
        getMethod.invoke(null, name) as String
    } catch (_: Exception) {
        null
    }
}

Risk

I see no risks

Test Coverage

I tested it on such a device

Validation Steps

Grep e.g. a Wanzl Fastlaner (German link, didn't find an English link) and run it there

@flutter-dashboard
Copy link

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine repository. See also e: labels. labels Jun 6, 2025
@jonahwilliams
Copy link
Member

I don't think we should cherry pick this. Your application can instead disable impeller until the next stable.

@@ -308,7 +325,7 @@ AndroidRenderingAPI FlutterMain::SelectedRenderingAPI(
// Even if this check returns true, Impeller may determine it cannot use
// Vulkan for some other reason, such as a missing required extension or
// feature. In these cases it will use OpenGLES.
if (api_level < kMinimumAndroidApiLevelForImpeller) {
if (api_level < kMinimumAndroidApiLevelForImpeller && !IsVivante()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct - should be api_level < kMinimumAndroidApiLevelForImpeller || IsVivante()

@matanlurey
Copy link
Contributor

Thanks. We believe you should opt-out of Impeller, and this fix will be integrated into the next stable.

Closing as rejected.

@matanlurey matanlurey closed this Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine flutter/engine repository. See also e: labels. platform-android Android applications specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.