Home > Back-end >  how to solve "Cannot resolve symbol" in xml file?
how to solve "Cannot resolve symbol" in xml file?

Time:09-17

I'm trying to make background logo in splash screen in flutter app.

It had to edit xml file in android/res/drawable folder. so I edited the code like below. But I get an error 'Cannot resolve symbol', and I've added the src file in the same position to the folder.

 <item>
    <bitmap
        android:gravity="center"
        android:src="@drawable/eye.png" />
</item> -->

folder files

CodePudding user response:

You just need to remove that .png from end

<bitmap
    android:gravity="center"
    android:src="@drawable/eye" />

CodePudding user response:

You just need to remove that .png from the end

<bitmap
    android:gravity="center"
    android:src="@drawable/eye" />

and for android s to remove default splash screen

import android.os.Build
import android.os.Bundle
import android.window.SplashScreenView
import androidx.core.view.WindowCompat
import io.flutter.embedding.android.FlutterActivity


class MainActivity : FlutterActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        // Aligns the Flutter view vertically with the window.
        WindowCompat.setDecorFitsSystemWindows(window, false)
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
            // Disable the Android splash screen fade out animation to avoid
            // a flicker before the similar frame is drawn in Flutter.
            splashScreen
                .setOnExitAnimationListener { splashScreenView: SplashScreenView -> splashScreenView.remove() }
        }
        super.onCreate(savedInstanceState)
    }
}
  • Related