Android 8.0上的谷歌地图膨胀异常

时间:2017-11-28 09:00:52

标签: java android google-maps-api-2 android-8.0-oreo

我们正在开发一款使用Google地图sdk的应用。唯一的问题是应用程序在Android 8及更高版本上崩溃。所有其他版本没有任何问题。

传递介绍活动并获得权限后,在设置内容视图中的主要活动onCreate上显示。

logcat错误消息是:

E/AndroidRuntime:     at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
  at android.graphics.drawable.AdaptiveIconDrawable.updateLayerFromTypedArray(AdaptiveIconDrawable.java:516)
  at android.graphics.drawable.AdaptiveIconDrawable.inflateLayers(AdaptiveIconDrawable.java:480)
  at android.graphics.drawable.AdaptiveIconDrawable.inflate(AdaptiveIconDrawable.java:229)
  at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
  at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1295)
  at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1254)
  at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:791)
  at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:621)
  at android.content.res.Resources.loadDrawable(Resources.java:886)
  at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
  at android.graphics.drawable.AdaptiveIconDrawable.updateLayerFromTypedArray(AdaptiveIconDrawable.java:516)
  at android.graphics.drawable.AdaptiveIconDrawable.inflateLayers(AdaptiveIconDrawable.java:480)
  at android.graphics.drawable.AdaptiveIconDrawable.inflate(AdaptiveIconDrawable.java:229)
  at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
  at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1295)
  at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1254)
  at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:791)
  at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:621)
  at android.content.res.Resources.loadDrawable(Resources.java:886)
  at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
  at android.graphics.drawable.AdaptiveIconDrawable.updateLayerFromTypedArray(AdaptiveIconDrawable.java:516)
  at android.graphics.drawable.AdaptiveIconDrawable.inflateLayers(AdaptiveIconDrawable.java:480)
  at android.graphics.drawable.AdaptiveIconDrawable.inflate(AdaptiveIconDrawable.java:229)
  at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
  at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1295)
  at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1254)
  at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:791)
  at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:621)
  at android.content.res.Resources.loadDrawable(Resources.java:886)
  at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
  at android.graphics.drawable.AdaptiveIconDrawable.updateLayerFromTypedArray(AdaptiveIconDrawable.java:516)
  at android.graphics.drawable.AdaptiveIconDrawable.inflateLayers(AdaptiveIconDrawable.java:480)
  at android.graphics.drawable.AdaptiveIconDrawable.inflate(AdaptiveIconDrawable.java:229)
  at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
  at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1295)
  at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1254)
  at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:791)
  at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:621)
  at android.content.res.Resources.loadDrawable(Resources.java:886)
  at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
  at android.graphics.drawable.AdaptiveIconDrawable.updateLayerFromTypedArray(AdaptiveIconDrawable.java:516)
  at android.graphics.drawable.AdaptiveIconDrawable.inflateLayers(AdaptiveIconDrawable.java:480)
  at android.graphics.drawable.AdaptiveIconDrawable.inflate(AdaptiveIconDrawable.java:229)
  at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)

1 个答案:

答案 0 :(得分:0)

请检查App资源文件夹中的任何DPI。你必须处理它。