简体   繁体   中英

ti.map android v2 appcelerator map error

i cannot for the life of me get a map to work on my android device - can anyone decode this log trace ?

win 7 - studio build 4.1.1 - sdk 4.1.0.GA - ti.map 2.3.1 - android tools 20.0.1 - (i have tried varying combinations of sdk and map version) i ran the keytool on dev_keystore and the sha1 is in google console as an android key with right package name etc - the map is from the docs example:

var win = Ti.UI.currentWindow;
var MapModule = require('ti.map');
var appc = MapModule.createAnnotation({
    latitude: 37.389569,
    longitude: -122.050212,
    title: 'Appcelerator HQ',
    subtitle: 'Mountain View, CA',
    pincolor: MapModule.ANNOTATION_GREEN
});
var apple = MapModule.createAnnotation({
    latitude: 37.331689,
    longitude: -122.030731,
    title: 'Apple HQ',
    subtitle: 'Cupertino, CA',
    pincolor: MapModule.ANNOTATION_RED
});
var google = MapModule.createAnnotation({
    latitude: 37.422502,
    longitude: -122.0855498,
    title: 'Google HQ',
    subtitle: 'Mountain View, CA',
    pincolor: MapModule.ANNOTATION_VIOLET
});
var route = MapModule.createRoute({
    width: 4,
    color: '#f00',
    points: [
        {latitude:google.latitude, longitude:google.longitude},
        {latitude:appc.latitude, longitude:appc.longitude},
        {latitude:apple.latitude, longitude:apple.longitude}
    ]
});
var mapview = MapModule.createView({
    mapType: MapModule.NORMAL_TYPE,
    region: {latitude: 37.389569, longitude: -122.050212, latitudeDelta: 0.2, longitudeDelta: 0.2},
    annotations: [google,appc,apple]
});
mapview.addRoute(route);
win.add(mapview);

this is the trace for the window

[INFO] :   dalvikvm: Could not find method org.appcelerator.titanium.proxy.TiViewProxy.toImage, referenced from method ti.map.AnnotationProxy.handleCustomView
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 46223: Lorg/appcelerator/titanium/proxy/TiViewProxy;.toImage ()Lorg/appcelerator/kroll/KrollDict;
[INFO] :   dalvikvm: Could not find method android.app.Notification$Builder.setPriority, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorNotification
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 292: Landroid/app/Notification$Builder;.setPriority (I)Landroid/app/Notification$Builder;
[INFO] :   u: Making Creator dynamically
[INFO] :   dalvikvm: Could not find method android.app.Notification$Builder.setPriority, referenced from method com.google.android.gms.common.mz.b
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 142: Landroid/app/Notification$Builder;.setPriority (I)Landroid/app/Notification$Builder;
[INFO] :   dalvikvm: Could not find method android.app.Notification$Builder.setLocalOnly, referenced from method com.google.android.gms.common.mz.b
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 141: Landroid/app/Notification$Builder;.setLocalOnly (Z)Landroid/app/Notification$Builder;
[ERROR] :  dalvikvm: Could not find class 'android.app.Notification$BigTextStyle', referenced from method com.google.android.gms.common.mz.b
[WARN] :   dalvikvm: VFY: unable to resolve new-instance 39 (Landroid/app/Notification$BigTextStyle;) in Lcom/google/android/gms/common/mz;
[ERROR] :  dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.nb.a
[WARN] :   dalvikvm: VFY: unable to resolve check-cast 27 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/nb;
[INFO] :   dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.nb.a
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 424: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
[ERROR] :  dalvikvm: Could not find class 'android.os.UserManager', referenced from method com.google.android.gms.common.nb.p
[WARN] :   dalvikvm: VFY: unable to resolve check-cast 225 (Landroid/os/UserManager;) in Lcom/google/android/gms/common/nb;
[WARN] :   dalvikvm: VFY: unable to resolve static field 119 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
[WARN] :   dalvikvm: VFY: unable to resolve static field 118 (SUPPORTED_32_BIT_ABIS) in Landroid/os/Build;
[WARN] :   dalvikvm: VFY: unable to resolve static field 119 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
[WARN] :   dalvikvm: VFY: unable to resolve static field 120 (SUPPORTED_ABIS) in Landroid/os/Build;
[INFO] :   dalvikvm: DexOpt: unable to optimize static field ref 0x0077 at 0x17 in Lcom/google/android/chimera/container/j;.a
[INFO] :   dalvikvm: DexOpt: unable to optimize static field ref 0x0076 at 0x26 in Lcom/google/android/chimera/container/j;.a
[INFO] :   dalvikvm: DexOpt: unable to optimize static field ref 0x0077 at 0x0d in Lcom/google/android/chimera/container/j;.b
[INFO] :   I/Google Maps Android API: Google Play services client version: 6171000
[INFO] :   I/Google Maps Android API: Google Play services package version: 8489034
[ERROR] :  dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.mw.a
[WARN] :   dalvikvm: VFY: unable to resolve check-cast 14 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/mw;
[INFO] :   dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.mw.a
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 118: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
[ERROR] :  dalvikvm: Could not find class 'android.os.UserManager', referenced from method com.google.android.gms.common.mw.a
[WARN] :   dalvikvm: VFY: unable to resolve check-cast 115 (Landroid/os/UserManager;) in Lcom/google/android/gms/common/mw;
[INFO] :   dalvikvm: Could not find method android.widget.ImageView.setBackground, referenced from method com.google.maps.api.android.lib6.e.ae.a
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 1613: Landroid/widget/ImageView;.setBackground (Landroid/graphics/drawable/Drawable;)V
[INFO] :   dalvikvm: Could not find method android.widget.RelativeLayout$LayoutParams.setMarginStart, referenced from method com.google.maps.api.android.lib6.e.dp.a
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 1641: Landroid/widget/RelativeLayout$LayoutParams;.setMarginStart (I)V
[INFO] :   dalvikvm: Could not find method com.google.maps.api.android.lib6.e.eh.setBackground, referenced from method com.google.maps.api.android.lib6.e.eh.<init>
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 8856: Lcom/google/maps/api/android/lib6/e/eh;.setBackground (Landroid/graphics/drawable/Drawable;)V
[WARN] :   ApplicationContext: Unable to create external cache directory
[WARN] :   dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x40acc228)
[ERROR] :  TiApplication: (main) [10677,35465] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.theibizaapp/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException; Titanium 4.1.0,2015/07/06 11:15,d57aa7d
[ERROR] :  TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.theibizaapp/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException
[ERROR] :  TiApplication:   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2194)
[ERROR] :  TiApplication:   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
[ERROR] :  TiApplication:   at android.app.ActivityThread.access$600(ActivityThread.java:139)
[ERROR] :  TiApplication:   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
[ERROR] :  TiApplication:   at android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR] :  TiApplication:   at android.os.Looper.loop(Looper.java:154)
[ERROR] :  TiApplication:   at android.app.ActivityThread.main(ActivityThread.java:4944)
[ERROR] :  TiApplication:   at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] :  TiApplication:   at java.lang.reflect.Method.invoke(Method.java:511)
[ERROR] :  TiApplication:   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
[ERROR] :  TiApplication:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
[ERROR] :  TiApplication:   at dalvik.system.NativeStart.main(Native Method)
[ERROR] :  TiApplication: Caused by: java.lang.NullPointerException
[ERROR] :  TiApplication:   at com.google.maps.api.android.lib6.gmm6.m.ad.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.maps.api.android.lib6.gmm6.c.h.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.maps.api.android.lib6.gmm6.c.ao.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.maps.api.android.lib6.e.bd.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.maps.api.android.lib6.e.ev.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.maps.api.android.lib6.e.z.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.maps.api.android.lib6.e.y.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.maps.internal.u.onTransact(SourceFile:107)
[ERROR] :  TiApplication:   at android.os.Binder.transact(Binder.java:297)
[ERROR] :  TiApplication:   at com.google.android.gms.maps.internal.IMapFragmentDelegate$a$a.onCreateView(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.maps.SupportMapFragment$a.onCreateView(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.dynamic.a$4.b(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.dynamic.a.a(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.dynamic.a.onCreateView(Unknown Source)
[ERROR] :  TiApplication:   at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source)
[ERROR] :  TiApplication:   at android.support.v4.app.Fragment.performCreateView(Fragment.java:1789)
[ERROR] :  TiApplication:   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:955)
[ERROR] :  TiApplication:   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
[ERROR] :  TiApplication:   at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
[ERROR] :  TiApplication:   at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
[ERROR] :  TiApplication:   at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:551)
[ERROR] :  TiApplication:   at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1187)
[ERROR] :  TiApplication:   at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1195)
[ERROR] :  TiApplication:   at android.app.Activity.performStart(Activity.java:4541)
[ERROR] :  TiApplication:   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2167)
[ERROR] :  TiApplication:   ... 11 more

It seems like you havn't the latest version of android support library. Use the SDK Manager to Download the library: https://developer.android.com/tools/support-library/setup.html After that, clean your project and compile again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM