hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium
Other
87 stars 26 forks source link

Bug: Crash on "addAnnotation" #54

Closed cansoysal closed 7 years ago

cansoysal commented 7 years ago

Hi, I am having difficulties adding annotation to map. AddAnnotation method is just crashing the app. iOS 10 + 5.5.0.GA

Here is the simple code to test.

var maps = require("ti.googlemaps");
maps.setAPIKey(APIKEY);

var mapView = maps.createView({
    mapType: maps.MAP_TYPE_TERRAIN,
    indoorEnabled: true, // shows indoor polygons of mapped indoor venues
    indoorPicker: true, // shows the vertical floor level
    compassButton: true, // shows the compass (top/right) when bearing is non-zero
    myLocationEnabled: true,
    myLocationButton: true, // shows the default My location button
    region: { // Camera center of the map
        latitude: 37.368122,
        longitude: -121.913653,
        zoom: 10, // Zoom in points
        bearing: 45, // orientation measured in degrees clockwise from north
        viewingAngle: 30 // measured in degrees
    }
});

var annotation1 = maps.createAnnotation({
    latitude: 37.368122,
    longitude: -121.913653,
    title : "titleHere",
    subtitle : "subtitleHere"
});

mapView.addAnnotation(annotation1);
$.index.add(mapView);

$.index.open();

Here is the trace output [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Cannot find image dav_one_way_16_256 [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Image data can't be NULL. [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Invalid texture state for dav_one_way_16_256. [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Cannot find image polyline_colors_texture [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Image data can't be NULL. [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Invalid texture state for routesTextureState. [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Cannot find image polyline_colors_texture_dim [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Image data can't be NULL. [DEBUG] : 2016-10-07 00:45:08.348 googleMapsTest57615:249656 was false: Invalid texture state for routesDimTextureState. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetStrokeColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextGetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetStrokeColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextGetBlendMode: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetBlendMode: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetBlendMode: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetStrokeColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextGetBlendMode: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetBlendMode: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : Oct 7 00:45:08 googleMapsTest[57615] : CGContextSetBlendMode: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. [DEBUG] : 2016-10-07 00:45:08.374 googleMapsTest57615:249656 was false: Cannot find image GMSSprites-0-2x [DEBUG] : 2016-10-07 00:45:08.374 googleMapsTest57615:249656 was false: Image data can't be NULL. [DEBUG] : 2016-10-07 00:45:08.374 googleMapsTest57615:249656 was false: Cannot find image GMSNavSprites-0-2x [DEBUG] : 2016-10-07 00:45:08.374 googleMapsTest57615:249656 was false: Image data can't be NULL. [DEBUG] : 2016-10-07 00:45:08.374 googleMapsTest57615:249656 was false: Cannot find image GMSNavNightModeSprites-0-2x [DEBUG] : 2016-10-07 00:45:08.374 googleMapsTest57615:249656 was false: Image data can't be NULL.

yozef commented 7 years ago

Same here.

[WARN] :   Ti.GoogleMaps: MapView is deprecated since View in favor of 2.2.0
// The 2 Warnings Below gets repeated for each Annotation
[WARN] :   Oct 14 09:05:16  TiGoogleMaps[73822] <Error>: CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
[WARN] :   Oct 14 09:05:16  TiGoogleMaps[73822] <Error>: CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
cansoysal commented 7 years ago

@yozef I only set debug level to trace

hansemannn commented 7 years ago

Could be fixed by using the new Google Maps iOS SDK 2.1.0, please try https://github.com/hansemannn/ti.googlemaps/pull/51

cansoysal commented 7 years ago

Unfortunately 2.1.0 made no difference, it keep crashing :/

yozef commented 7 years ago

as well as 2.6.0 :( of last week, I did see an update to 2.6.0 however, I was not able to compile the module:

$> appc ti build -p ios --build-only
Appcelerator Command-Line Interface, version 5.5.1
Copyright (c) 2014-2016, Appcelerator, Inc.  All Rights Reserved.

10/18/2016, 8:04:51 AM

Operating System
  Name                        = Mac OS X
  Version                     = 10.12
  Architecture                = 64bit
  # CPUs                      = 8
  Memory                      = 34359738368

Node.js
  Node.js Version             = 0.12.7
  npm Version                 = 2.11.3

Titanium CLI
  CLI Version                 = 5.0.9

Titanium SDK
  SDK Version                 = 5.5.1.GA
  SDK Path                    = /Users/yozef/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA
  Target Platform             = iphone

Command
  /usr/local/bin/node /Users/yozef/.appcelerator/install/5.5.1/package/node_modules/titanium/lib/titanium.js build -p ios --build-only --config-file /var/folders/g0/p39677wx7m37r978qybw_69r0000gn/T/build-1476792289397.json --log-level info --no-banner --project-dir /Users/yozef/Documents/ti.googlemaps-Fix/ios

[INFO]  Project directory: /Users/yozef/Documents/ti.googlemaps-Fix/ios
[INFO]  Module ID: ti.googlemaps
[INFO]  Creating module zip
An uncaught exception was thrown!
ENOENT, no such file or directory '/Users/yozef/Documents/ti.googlemaps-Fix/ios/platform/GoogleMapsBase.framework/Resources'
ENOENT, no such file or directory '/Users/yozef/Documents/ti.googlemaps-Fix/ios/platform/GoogleMapsBase.framework/Resources'

I should also note, that '/Users/yozef/Documents/ti.googlemaps-Fix/ios/platform/GoogleMapsBase.framework/Resources' exists:

2016-10-18 at 8 07 47 am
hansemannn commented 7 years ago

This is not reproducible using 2.6.0 B2, @yozef confirmed yesterday.