我正在尝试将 Google Maps v2 与我的 android 应用程序一起使用。我目前将 Google Play 服务作为图书馆项目。我正在使用带有 Gradle 1.7 的 Android Studio v0.2.6。
构建.gradle
compileSdkVersion "Google Inc.:Google APIs:17"
buildToolsVersion "17"
defaultConfig {
minSdkVersion 9
targetSdkVersion 17
}
设置.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();
}
}
有没有人解决了这个问题或有任何关于导致这个错误的原因或它的含义的信息?