Android Studio 4 incorrect vector drawable preview

后端 未结 3 911
温柔的废话
温柔的废话 2021-01-04 02:06

After update to Android Studio 4.0, all my vector icons display wrong on the preview screen. But they look normal after running an application on the device. It concerns all

相关标签:
3条回答
  • 2021-01-04 02:35

    In your build.gradle file

    android { 
              defaultConfig
                          {
                               vectorDrawables.useSupportLibrary = true 
                          }
            }
    
    dependencies {  
                 compile 'com.android.support:appcompat-v7:23.2.0' 
                 }
    

    and use app:srcCompat instead of android:src

    Invalid Caches/Restart

    then try to create a new drawable vector its should works..

    0 讨论(0)
  • 2021-01-04 02:40

    I fixed it by disabling Settings -> Experimental -> Use new Layout Rendering Engine.

    0 讨论(0)
  • 2021-01-04 02:47

    This is probably because you have a non-default locale (to check run locale in terminal). In particular LC_NUMERIC. If that's the case, to fix the issue run the studio with e.g. LC_NUMERIC="en_US.UTF-8".

    0 讨论(0)
提交回复
热议问题