Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20410

Android: Adding view as a customView to an annotation in maps crashes the app

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 5.2.0
    • Fix Version/s: Release 5.2.0
    • Component/s: Android
    • Environment:
    • Sprint:
      2016 Sprint 4 SDK

      Description

      NOTE: This is a regression. Not seen in 5.1.2.GA.

      Steps to reproduce:

      1. Use the below code in your app.js & make sure you are setup for android maps before running this:

      var MapModule = require('ti.map');
       
      var win = Ti.UI.createWindow({
      		fullscreen : false
      	});
      	
      var myView1 = Ti.UI.createView({
      	width : 100,
      	height : 100,
      	backgroundColor : 'red'
      });
       
      var anno = MapModule.createAnnotation({
      	latitude : -33.87365,
      	customView : myView1,
      	longitude : 151.20689,
      	title : "Drag Me",
      	subtitle : "Sydney is quite chill",
      	draggable : true
      });
       
      var map = MapModule.createView({
      	userLocation : true,
      	mapType : MapModule.NORMAL_TYPE,
      	animate : true,
      	annotations : [anno],
      	region : {
      		latitude : -33.87365,
      		longitude : 151.20689,
      		latitudeDelta : 0.1,
      		longitudeDelta : 0.1
      	}, //Sydney
      	// top : '30%'
      });
       
      win.add(map);
      win.open();
      

      2. Let the app launch on device.

      Actual Results:

      1. App crashes with logs:

      *[ERROR] :  TiApplication: (main) [582,959] Sending event: exception on thread: main msg:java.lang.NoSuchMethodError: No virtual method toImage()Lorg/appcelerator/titanium/TiBlob; in class Lorg/appcelerator/titanium/proxy/TiViewProxy; or its super classes (declaration of 'org.appcelerator.titanium.proxy.TiViewProxy' appears in /data/app/com.appcelerator.mapmod-1/base.apk); Titanium 5.2.0,2016/02/16 09:13,e72b2b5
      [ERROR] :  TiApplication: java.lang.NoSuchMethodError: No virtual method toImage()Lorg/appcelerator/titanium/TiBlob; in class Lorg/appcelerator/titanium/proxy/TiViewProxy; or its super classes (declaration of 'org.appcelerator.titanium.proxy.TiViewProxy' appears in /data/app/com.appcelerator.mapmod-1/base.apk)
      [ERROR] :  TiApplication: 	at ti.map.AnnotationProxy.handleCustomView(AnnotationProxy.java:206)
      [ERROR] :  TiApplication: 	at ti.map.AnnotationProxy.processOptions(AnnotationProxy.java:192)
      [ERROR] :  TiApplication: 	at ti.map.TiUIMapView.addAnnotation(TiUIMapView.java:393)
      [ERROR] :  TiApplication: 	at ti.map.TiUIMapView.addAnnotations(TiUIMapView.java:406)
      [ERROR] :  TiApplication: 	at ti.map.TiUIMapView.processMapProperties(TiUIMapView.java:211)
      [ERROR] :  TiApplication: 	at ti.map.TiUIMapView.onMapReady(TiUIMapView.java:162)
      [ERROR] :  TiApplication: 	at com.google.android.gms.maps.SupportMapFragment$zza$1.zza(Unknown Source)
      [ERROR] :  TiApplication: 	at com.google.android.gms.maps.internal.zzm$zza.onTransact(Unknown Source)
      [ERROR] :  TiApplication: 	at android.os.Binder.transact(Binder.java:387)
      [ERROR] :  TiApplication: 	at com.google.android.gms.maps.internal.be.a(SourceFile:82)
      [ERROR] :  TiApplication: 	at com.google.maps.api.android.lib6.e.fb.run(Unknown Source)
      [ERROR] :  TiApplication: 	at android.os.Handler.handleCallback(Handler.java:739)
      [ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:95)
      [ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:148)
      [ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5417)
      [ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Native Method)
      [ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      [ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
      

      Expected Results:

      1. App should not crash & view should be visible on the annotation.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                lchoudhary Lokesh Choudhary
                Reviewer:
                Ashraf Abu (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20961
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code