Google Maps v2 - 应用程序未安装在 2.3 设备上

Posted

技术标签:

【中文标题】Google Maps v2 - 应用程序未安装在 2.3 设备上【英文标题】:Google Maps v2 - App not installing on 2.3 device 【发布时间】:2013-08-29 17:46:48 【问题描述】:

我正在尝试将 Google Maps v2 与我的 android 应用程序一起使用。我目前将 Google Play 服务作为图书馆项目。我正在使用带有 Gradle 1.7 的 Android Studio v0.2.6。

build.gradle

compileSdkVersion "Google Inc.:Google APIs:17"
    buildToolsVersion "17"

    defaultConfig 
        minSdkVersion 9
        targetSdkVersion 17
    

settings.gradle

... ':google-play-services_lib'

它可以在 Android 4.1(HTC One X) 设备上正常安装,但是如果我尝试在运行 Android 2.3(HTC Sensation、Samsung Galaxy S) 的设备上安装它,我会收到以下错误:

失败 [INSTALL_FAILED_DEXOPT]

08-27 16:55:33.680    2582-2582/? D/installd: DexInv: --- BEGIN '/data/app/nz.co.nuffie.android.crichq-2.apk' ---
08-27 16:55:34.025  32680-32680/? D/dalvikvm: creating instr width table
08-27 16:55:34.350  32680-32680/? D/dalvikvm: DexOpt: 'Landroid/media/Metadata;' has an earlier definition; blocking out
08-27 16:55:34.550  32680-32680/? D/dalvikvm: DexOpt: not verifying 'Landroid/media/Metadata;': multiple definitions
08-27 16:55:34.795  32680-32680/? D/dalvikvm: DexOpt: couldn't find static field
08-27 16:55:34.795  32680-32680/? D/dalvikvm: DexOpt: couldn't find static field
08-27 16:55:34.990  32680-32680/? D/dalvikvm: DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
08-27 16:55:35.540  32680-32680/? E/dalvikvm: LinearAlloc exceeded capacity (5242880), last=260
08-27 16:55:35.540  32680-32680/? E/dalvikvm: VM aborting
08-27 16:55:35.639    2574-2574/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-27 16:55:35.639    2574-2574/? I/DEBUG: Build fingerprint: 'samsung/GT-I9100T/GT-I9100T:2.3.3/GINGERBREAD/DOKH1:user/release-keys'
08-27 16:55:35.639    2574-2574/? I/DEBUG: pid: 32680, tid: 32680  >>> /system/bin/dexopt <<<
08-27 16:55:35.639    2574-2574/? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
08-27 16:55:35.639    2574-2574/? I/DEBUG: r0 fffffe84  r1 deadd00d  r2 00000026  r3 00000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: r4 800a560c  r5 004ffff4  r6 005000fc  r7 0001b02c
08-27 16:55:35.639    2574-2574/? I/DEBUG: r8 00000104  r9 00000005  10 00000009  fp 000020f1
08-27 16:55:35.639    2574-2574/? I/DEBUG: ip 800a5718  sp be80b6f0  lr afd19471  pc 80046360  cpsr 20000030
08-27 16:55:35.639    2574-2574/? I/DEBUG: d0  0000000000000000  d1  0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d2  0000000000000000  d3  0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d4  0000000000000000  d5  0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d6  0000000000000000  d7  0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d8  00000e4005a5b5ba  d9  0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d10 0000000000000000  d11 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d12 0000000000000000  d13 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d14 0000000000000000  d15 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d16 0000000000000000  d17 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d18 0000000000000000  d19 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d20 0000000000000000  d21 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d22 0000000000000000  d23 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d24 0000000000000000  d25 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d26 0000000000000000  d27 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d28 0000000000000000  d29 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: d30 0000000000000000  d31 0000000000000000
08-27 16:55:35.639    2574-2574/? I/DEBUG: scr 00000000
08-27 16:55:35.655    2574-2574/? I/DEBUG: #00  pc 00046360  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #01  pc 0004e602  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #02  pc 0006adb6  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #03  pc 0006b074  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #04  pc 0006b8a0  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #05  pc 0006bae2  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #06  pc 0006b322  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #07  pc 000576f8  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #08  pc 00057a24  /system/lib/libdvm.so
08-27 16:55:35.655    2574-2574/? I/DEBUG: #09  pc 0005ab48  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: #10  pc 0005b522  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: #11  pc 0005b75e  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: #12  pc 0005d130  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: #13  pc 0005d182  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: #14  pc 0005bfae  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: #15  pc 0005c05c  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: #16  pc 0005c160  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: code around pc:
08-27 16:55:35.660    2574-2574/? I/DEBUG: 80046340 447a4479 f7d14c0b 2000e926 ea2af7d1
08-27 16:55:35.660    2574-2574/? I/DEBUG: 80046350 447c4809 6bdb5823 4798b103 22264902
08-27 16:55:35.660    2574-2574/? I/DEBUG: 80046360 f7d1700a bf00ea92 deadd00d 00043ab3
08-27 16:55:35.660    2574-2574/? I/DEBUG: 80046370 00045671 0005f2b6 fffffe84 4b09b40e
08-27 16:55:35.660    2574-2574/? I/DEBUG: 80046380 4c09b517 aa05447b f852591b 6b5b1b04
08-27 16:55:35.660    2574-2574/? I/DEBUG: code around lr:
08-27 16:55:35.660    2574-2574/? I/DEBUG: afd19450 4a0e4b0d e92d447b 589c41f0 26004680
08-27 16:55:35.660    2574-2574/? I/DEBUG: afd19460 686768a5 f9b5e006 b113300c 47c04628
08-27 16:55:35.660    2574-2574/? I/DEBUG: afd19470 35544306 37fff117 6824d5f5 d1ef2c00
08-27 16:55:35.660    2574-2574/? I/DEBUG: afd19480 e8bd4630 bf0081f0 000280cc ffffff88
08-27 16:55:35.660    2574-2574/? I/DEBUG: afd19490 b086b570 f602fb01 9004460c a804a901
08-27 16:55:35.660    2574-2574/? I/DEBUG: stack:
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6b0  4004c280
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6b4  401d5150
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6b8  800ab1b0
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6bc  800a560c
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6c0  afd4272c
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6c4  afd426d8
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6c8  00000000
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6cc  afd19471  /system/lib/libc.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6d0  0005f2b6
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6d4  004ffff4
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6d8  005000fc
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6dc  0001b02c
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6e0  00000104
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6e4  afd18569  /system/lib/libc.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6e8  df002777
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6ec  e3a070ad
08-27 16:55:35.660    2574-2574/? I/DEBUG: #00 be80b6f0  0001b028
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6f4  8004e607  /system/lib/libdvm.so
08-27 16:55:35.660    2574-2574/? I/DEBUG: #01 be80b6f8  00000104
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b6fc  00000104
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b700  419d9139
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b704  401d5150
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b708  0001faf0
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b70c  41676e0c
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b710  00000000
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b714  00000005
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b718  00000009
08-27 16:55:35.660    2574-2574/? I/DEBUG: be80b71c  8006adbb  /system/lib/libdvm.so
08-27 16:55:35.670    2574-2574/? I/DEBUG: dumpstate /data/log/dumpstate_app_native.txt
08-27 16:55:35.675  32682-32682/? I/dumpstate: begin
08-27 16:55:35.675    2696-2699/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.680    2696-2699/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.680    2810-2817/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.685    2810-2817/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.685    2835-2840/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.685    2835-2840/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.685    2842-2849/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.685    2842-2849/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.685    2844-2857/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.685    2844-2857/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.685    2855-2872/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.690    2855-2872/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.690    2859-2871/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.690    2859-2871/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.690    2874-2886/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.690    2874-2886/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.690    2888-2892/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.690    2888-2892/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.690    2902-2906/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.695    2902-2906/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.695    2965-2968/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.695    2965-2968/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.695    3171-3174/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.700    3171-3174/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.700    3489-3492/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.700    3489-3492/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.700    3574-3578/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.700    3574-3578/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.700    3656-3659/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.700    3656-3659/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.700    3663-3666/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.705    3663-3666/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.705    4011-4014/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.705    4011-4014/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.705    4080-4083/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.705    4080-4083/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.705  16502-16505/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.710  16502-16505/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.710  25030-25033/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.710  25030-25033/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.710  25049-25052/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.715  25049-25052/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.715  25123-25126/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.725  25123-25126/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.725  25762-25765/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.725  25762-25765/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.725  26592-26595/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.725  26592-26595/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.725  26899-26902/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.725  26899-26902/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.725  26973-26976/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.725  26973-26976/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.725  27343-27346/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.725  27343-27346/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.725  27410-27413/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.725  27410-27413/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.725  30078-30082/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.730  30078-30082/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.730  30087-30090/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.730  30087-30090/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.730  30094-30097/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.730  30094-30097/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.730  30461-30464/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.735  30461-30464/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.735  30620-30623/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.735  30620-30623/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.735  30889-30892/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.735  30889-30892/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.735  31004-31007/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.735  31004-31007/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.735  31109-31112/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.735  31109-31112/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.735  31732-31735/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.740  31732-31735/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.740  32024-32027/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.740  32024-32027/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.740  32031-32034/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.740  32031-32034/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.740  32040-32043/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.740  32040-32043/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.740  32126-32129/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.745  32126-32129/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.745  32187-32190/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.745  32187-32190/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.745  32633-32636/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.745  32633-32636/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:35.745  32671-32674/? I/dalvikvm: threadid=4: reacting to signal 3
08-27 16:55:35.750  32671-32674/? I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
08-27 16:55:39.140    2571-2653/? D/VoldCmdListener: asec list
08-27 16:55:39.150    2696-2735/? W/ProcessStats: Skipping unknown process pid 32691
08-27 16:55:39.165  31732-31732/? D/dalvikvm: GC_EXPLICIT freed 7K, 53% free 2531K/5379K, external 0K/0K, paused 22ms
08-27 16:55:40.895  32682-32682/? I/dumpstate: done
08-27 16:55:40.980    2582-2582/? W/installd: DexInv: --- END '/data/app/nz.co.nuffie.android.crichq-2.apk' --- status=0x000b, process failed
08-27 16:55:40.980    2582-2582/? E/installd: dexopt failed on '/data/dalvik-cache/data@app@nz.co.nuffie.android.crichq-2.apk@classes.dex' res = 11

我的应用程序正在使用 Action Bar Sherlock 和 SupportMapFragment。

活动

import com.google.android.gms.maps.SupportMapFragment;

public class MyActivity extends SherlockFragmentActivity

...

private void setUpMapIfNeeded() 
    // Try to obtain the map from the SupportMapFragment.
    googleMap = ((SupportMapFragment)   getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
    // Check if we were successful in obtaining the map.
    if (googleMap != null) 
        setUpMap();
    

有没有人解决过这个问题,或者有任何关于导致这个错误的原因或它的含义的信息?

【问题讨论】:

您在安装应用程序或在 2.3 上运行应用程序时遇到问题? 尝试在 2.3 设备上安装应用程序时出现此错误。我已经添加了用于问题的设备。 如何编译apk并通过adb单独安装。你能试试吗? Android Studio 使用 adb 将应用程序安装到设备上,因此这不会产生影响。但是我也尝试使用 adb 通过终端安装。我收到了同样的错误 INSTALL_FAILED_DEXOPT。 【参考方案1】:

您应该使用 FragmentActivity 中的 SupportMapFragment,而不是 Activity 中的 MapFragment。当然使用 v4 支持库。

编辑:

发现这可能是同样的问题: Dalvikvm crashes with "LinearAlloc exceeded capacity" when running unit tests on emulator 1.6

【讨论】:

我正在使用来自 v4 支持库的 SupportMapFragment。更新的问题。 为什么投反对票?你刚刚说你在编辑问题后现在正在使用它......那么祝你好运......【参考方案2】:

当您使用的方法或字段仅在较高的 Android SDK 版本中可用但在较低的 Android SDK 版本中不可用时,通常会发生这种情况。 因此,对于您收到的警告:

'DexOpt: 找不到字段 landroid/content/res/Configuration;.smallestScreenWidthDp'

请检查“smallestScreenWidthDp”字段是否在 Android 2.3 SDK 中可用于类配置

【讨论】:

【参考方案3】:

可能是因为这个问题: Include Http-4.2.1 with Android App

这有一个类似的问题: https://jira.springsource.org/browse/ANDROID-14

我发现在你的日志中用这些行搜索:

dalvikvm:DexOpt:有更早的定义;阻止dalvikvm: DexOpt:不验证多个定义

看起来可能存在冲突。 与“Landroid/content/res/Configuration”或“Landroid/media/Metadata”冲突。

但如果是这种情况,我不知道为什么它只会导致 2.1 而不是 4.0+ 的问题。好吧,除非他们从核心 Android 中删除了一个库,我看到他们是通过阅读第二个链接这样做的。

编辑:

这个日志中有一个类似的错误: “DexOpt:找不到字段 Landroid/content/res/Configuration;.smallestScreenWidthDp”

问题是地图 api 密钥错误。

Google Maps Android v2 Authorization failure

否则: "LinearAlloc 超出容量 (5242880),last=260"

http://birbit.com/how-to-solve-linearalloc-problem/

【讨论】:

我已经从我的项目中删除了 MetaData.jar 库,它确实删除了 logcat 中的那些相关行。但仍然失败并且“DexOpt:找不到静态字段”仍然存在。【参考方案4】:

我建议将以下依赖项添加到 build.gradle 文件中的依赖项中

dependencies 
    // Google Play Services
    compile 'com.google.android.gms:play-services:3.2.25'

【讨论】:

以上是关于Google Maps v2 - 应用程序未安装在 2.3 设备上的主要内容,如果未能解决你的问题,请参考以下文章

Google Maps Android API V2 检查 Google Maps 应用程序是不是被禁用

Google Maps Android API V2 检查设备上是不是安装了 GoogleMaps

Swift:未安装 Google Maps 时,应用程序需要打开 Apple Maps

Google Maps Api v3 - getBounds 未定义

在 Google Maps API v2 中更改标记大小

如何设置 Android Google Maps API v2 地图以显示全球地图?