【问题标题】:Issue with instant run and Google Maps即时运行和谷歌地图的问题
【发布时间】:2017-05-24 07:45:37
【问题描述】:

即时运行和 Google 地图似乎存在问题。重新运行应用程序以查看更改时,如果应用程序正在使用 Google 地图,则会发生崩溃。这是堆栈跟踪的一部分:

java.lang.RuntimeException: 
android.content.res.Resources$NotFoundException: File res/drawable/common_google_signin_btn_text_light_focused.xml from drawable resource ID 
           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
           ........
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/common_google_signin_btn_text_light_focused.xml from drawable resource ID 
          at android.content.res.Resources.loadDrawableForCookie(Resources.java:2640)
          .....
Caused by: android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/maps_btn_myl_pressed.png from drawable resource ID

由于ResourcesNotFoundException 而发生崩溃,这似乎是由上述堆栈跟踪中列出的文件引起的。

有没有人遇到过这个问题,如果有,解决方法是什么?

【问题讨论】:

  • 它明确表示没有找到可绘制对象,请再次检查
  • @W4R10CK 这些drawables不是我项目的一部分。
  • common_google_signin_btn_text_light_focused.xml 的 id 有问题,请检查该问题。
  • 我也遇到了同样的问题,还是没有解决办法。
  • 这里有同样的问题,所以推荐的问题...看起来很老了,你找到解决方案了吗?

标签: android google-maps android-studio android-instant-run instant-run


【解决方案1】:

gradle 文件中试试这个:

android {  
    defaultConfig {  
         vectorDrawables.useSupportLibrary = true  
        }  
}

并使用最新的buildToolsVersion '28.0.3'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-26
    • 2012-03-15
    • 2014-04-05
    • 2011-12-26
    相关资源
    最近更新 更多