当显示谷歌地图v2时,应用程序崩溃

时间:2014-02-03 11:08:25

标签: android google-maps out-of-memory google-maps-android-api-2

我在我的应用程序中使用了Google地图版本2。在某些设备中随机App崩溃,特别是当谷歌地图出现时。 App崩溃时,下面是堆栈跟踪。如果有人可以建议我们如何解决它?

Caused by: android.view.InflateException: Binary XML file line #88: Error inflating class <unknown>
   at android.view.LayoutInflater.createView(LayoutInflater.java:626)
   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
   at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
   at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
   at android.app.Activity.setContentView(Activity.java:1956)
   at com.OilBlackGold.RoutePath.onCreate(RoutePath.java:106)
   at android.app.Activity.performCreate(Activity.java:5372)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
   ... 11 more
Caused by: java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Constructor.constructNative(Native Method)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
   at android.view.LayoutInflater.createView(LayoutInflater.java:600)
   ... 25 more
Caused by: java.lang.OutOfMemoryError
   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:832)
   at android.content.res.Resources.loadDrawable(Resources.java:2988)
   at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
   at android.view.View.<init>(View.java:3563)
   at android.view.View.<init>(View.java:3492)
   at android.view.ViewGroup.<init>(ViewGroup.java:469)
   at android.widget.RelativeLayout.<init>(RelativeLayout.java:242)
   ... 28 more

1 个答案:

答案 0 :(得分:3)

问题是由OutOfMemoryError

引起的

你可能正在加载大型抽奖作为标记(?)。 增加较小的图标可能会解决问题。