Google Maps SDK Tutorial Crash - google-maps-sdk-ios

I am trying to get Google Maps set up in my iOS application, but am getting a crash on an InvalidArgumentException.
A few people have asked this same question already; however, they have either not gotten helpful responses, or the responses that were given did not solve the problem.
The code is copied directly from Google's Getting Started page:
#import "XXMapViewController.h"
#import <GoogleMaps/GoogleMaps.h>
#interface XXMapViewController ()
#end
#implementation XXMapViewController{
GMSMapView *mapView_;
}
- (void)viewDidLoad
{
[super viewDidLoad];
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
longitude:151.20
zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;
self.view = mapView_;
// Creates a marker in the center of the map.
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
marker.title = #"Sydney";
marker.snippet = #"Australia";
marker.map = mapView_;
// Do any additional setup after loading the view, typically from a nib.
}
#end
This is the line it crashes on, so I have determined it's not a problem with setting the view:
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
And here is the stack trace (app name is X'd out for anonymity's sake):
2014-04-17 14:24:19.909 XX App[28758:60b] -[GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance 0x10ae45a80
2014-04-17 14:24:19.931 XX App[28758:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance 0x10ae45a80'
*** First throw call stack:
(
0 CoreFoundation 0x0000000103b2b495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010388a99e objc_exception_throw + 43
2 CoreFoundation 0x0000000103bbc65d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000103b1cd8d ___forwarding___ + 973
4 CoreFoundation 0x0000000103b1c938 _CF_forwarding_prep_0 + 120
5 XX App 0x0000000100189323 -[GMSMapView setCamera:] + 161
6 XX App 0x0000000100187cc2 -[GMSMapView sharedInitWithServices:camera:] + 1440
7 XX App 0x00000001001870be -[GMSMapView initWithFrame:camera:] + 121
8 XX App 0x0000000100186f5f +[GMSMapView mapWithFrame:camera:] + 102
9 XX App 0x000000010000eeae -[XXMapViewController viewDidLoad] + 238
10 UIKit 0x000000010252d59e -[UIViewController loadViewIfRequired] + 562
11 UIKit 0x000000010252d777 -[UIViewController view] + 29
12 UIKit 0x00000001025442c5 -[UINavigationController _startCustomTransition:] + 628
13 UIKit 0x000000010254f6f5 -[UINavigationController _startDeferredTransitionIfNeeded:] + 401
14 UIKit 0x0000000102550238 -[UINavigationController __viewWillLayoutSubviews] + 43
15 UIKit 0x000000010266a895 -[UILayoutContainerView layoutSubviews] + 202
16 UIKit 0x0000000102497993 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 354
17 QuartzCore 0x0000000100e77802 -[CALayer layoutSublayers] + 151
18 QuartzCore 0x0000000100e6c369 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 363
19 QuartzCore 0x0000000100e6c1ea _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
20 QuartzCore 0x0000000100ddffb8 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 252
21 QuartzCore 0x0000000100de1030 _ZN2CA11Transaction6commitEv + 394
22 QuartzCore 0x0000000100de169d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89
23 CoreFoundation 0x0000000103af6dc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24 CoreFoundation 0x0000000103af6d37 __CFRunLoopDoObservers + 391
25 CoreFoundation 0x0000000103ad6522 __CFRunLoopRun + 946
26 CoreFoundation 0x0000000103ad5d83 CFRunLoopRunSpecific + 467
27 GraphicsServices 0x000000010491cf04 GSEventRunModal + 161
28 UIKit 0x0000000102437e33 UIApplicationMain + 1010
29 XX App 0x000000010000ed93 main + 115
30 libdyld.dylib 0x000000010434c5fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I have added the -ObjC flag to my project, and have tried adding it to the target as others have recommended; however, adding it to the target causes the build to fail. I created a new single view project as well, which worked fine when following the exact same instructions.I have the correct API key and Google Maps for iOS is enabled in my API console. This has been extraordinarily frustrating and a huge wall in the way of finishing my project. If anybody could point me in the right direction I would greatly appreciate it.

It was a conflict with Parse dependencies. The solution was to either eliminate the FB SDK dependencies or to just download the SDK. I chose the latter since I will inevitably be using it with my app.

Related

Error while using cenpy library in python

I am working on a project where I need to use census data for a couple of towns in MA. For that, I am using cenpy library ASC data, but I got a key error. The same error happens even when I try the example code described for Chicago. Here is the example code I use and the error I see:
chicago = products.ACS(2017).from_place('Chicago, IL', level='tract',
variables=['B00002*', 'B01002H_001E'])
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File ~\anaconda3\envs\oxe\lib\site-packages\cenpy\tiger.py:192, in ESRILayer.query(self, raw, strict, **kwargs)
191 try:
--> 192 features = datadict["features"]
193 except KeyError:
KeyError: 'features'
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 chicago = products.ACS(2017).from_place('Chicago, IL', level='tract',
2 variables=['B00002*', 'B01002H_001E'])
File ~\anaconda3\envs\oxe\lib\site-packages\cenpy\products.py:791, in ACS.from_place(self, place, variables, level, return_geometry, place_type, strict_within, return_bounds, replace_missing)
788 variables = self._preprocess_variables(variables)
789 variables.append("GEO_ID")
--> 791 geoms, variables, *rest = super(ACS, self).from_place(
792 place,
793 variables=variables,
794 level=level,
795 return_geometry=return_geometry,
796 place_type=place_type,
797 strict_within=strict_within,
798 return_bounds=return_bounds,
799 replace_missing=replace_missing,
800 )
801 variables["GEOID"] = variables.GEO_ID.str.split("US").apply(lambda x: x[1])
802 return_table = geoms[["GEOID", "geometry"]].merge(
803 variables.drop("GEO_ID", axis=1), how="left", on="GEOID"
804 )
File ~\anaconda3\envs\oxe\lib\site-packages\cenpy\products.py:200, in _Product.from_place(self, place, variables, place_type, level, return_geometry, geometry_precision, strict_within, return_bounds, replace_missing)
197 else:
199 placer = "STATE={} AND PLACE={}".format(placerow.STATEFP, placerow.TARGETFP)
--> 200 env = env_layer.query(where=placer)
202 print(
203 "Matched: {} to {} "
204 "within layer {}".format(
(...)
208 )
209 )
211 geoms, data = self._from_bbox(
212 env.to_crs(epsg=4326).total_bounds,
213 variables=variables,
(...)
219 replace_missing=replace_missing,
220 )
File ~\anaconda3\envs\oxe\lib\site-packages\cenpy\tiger.py:198, in ESRILayer.query(self, raw, strict, **kwargs)
196 if details is []:
197 details = "Mapserver provided no detailed error"
--> 198 raise KeyError(
199 (
200 r"Response from API is malformed. You may have "
201 r"submitted too many queries, formatted the request incorrectly, "
202 r"or experienced significant network connectivity issues."
203 r" Check to make sure that your inputs, like placenames, are spelled"
204 r" correctly, and that your geographies match the level at which you"
205 r" intend to query. The original error from the Census is:\n"
206 r"(API ERROR {}:{}({}))".format(code, msg, details)
207 )
208 )
209 todf = []
210 for i, feature in enumerate(features):
KeyError: 'Response from API is malformed. You may have submitted too many queries, formatted the request incorrectly, or experienced significant network connectivity issues. Check to make sure that your inputs, like placenames, are spelled correctly, and that your geographies match the level at which you intend to query. The original error from the Census is:\\n(API ERROR 400:Unable to complete operation.([]))'

Mutilple JSON root element errors

The file I am calling is JSON with padding and I have done my simple coding to remove the padding but it appears by stringing together multiple JSON strings the formatting is not correct and I get root element errors.
I am using the output of the python program and running it through an online JSON formatter and validator website to check my output. I am a learner so please bear with my inexperience. All help appreciated.
import json
import re
import requests
payload = {}
headers = {}
for race in range(1, 3):
url = f"https://s3-ap-southeast-2.amazonaws.com/racevic.static/2018-01-01/flemington/sectionaltimes/race-{race}.json?callback=sectionaltimes_callback"
response = requests.request("GET", url, headers=headers, data=payload)
strip = 'sectionaltimes_callback'
string = response.text
repl =''
result = re.sub(strip, repl, string)
print(result)
This is one way of obtaining the data you're looking for:
import requests
import json
import pandas as pd
headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0',
'Accept-Language' : 'en-US,en;q=0.5'}
for race in range(1, 3):
url = f"https://s3-ap-southeast-2.amazonaws.com/racevic.static/2018-01-01/flemington/sectionaltimes/race-{race}.json?callback=sectionaltimes_callback"
r = requests.get(url, headers=headers)
json_obj = json.loads(r.text.split('sectionaltimes_callback(')[1].rsplit(')', 1)[0])
df = pd.DataFrame(json_obj['Horses'])
print(df)
This would return (print out in terminal) a dataframe for each race:
Comment FinalPosition FinalPositionAbbreviation FullName SaddleNumber HorseUrl SilkUrl Trainer TrainerUrl Jockey ... DistanceVarToWinner SixHundredMetresTime TwoHundredMetresTime Early Mid Late OverallPeakSpeed PeakSpeedLocation OverallAvgSpeed DistanceFromRail
0 Resumes. Showed pace to lead well off the rail... 1 1st Crossing the Abbey 2 /horses/crossing-the-abbey //s3-ap-southeast-2.amazonaws.com/racevic.silk... T.Hughes /trainers/tim-hughes C.Williams ... 32.84 11.43 57.4 68.2 65.3 68.9 400m 63.3 0.8
1 Same sire as Katy's Daughter out of dual stake... 2 2nd Khulaasa 5 /horses/khulaasa //s3-ap-southeast-2.amazonaws.com/racevic.silk... D. & B.Hayes & T.Dabernig /trainers/david-hayes D.Oliver ... 0 32.61 11.29 56.6 68.4 66.0 69.2 700m 63.4 1.2
2 Trialled nicely before pleasing debut in what ... 3 3rd Graceful Star 4 /horses/graceful-star //s3-ap-southeast-2.amazonaws.com/racevic.silk... D. & B.Hayes & T.Dabernig /trainers/david-hayes A.Mallyon ... 0 33.10 11.56 56.9 67.4 64.8 68.5 400m 62.8 4.4
3 Sat second at debut, hampered at the 700m then... 4 4th Carnina 1 /horses/carnina //s3-ap-southeast-2.amazonaws.com/racevic.silk... T.Busuttin & N.Young /trainers/trent-busuttin B.Mertens ... +1 33.30 11.80 56.9 68.2 63.9 68.9 400m 62.7 3.0
4 $75k yearling by a Magic Millions winner out o... 5 5th Mirette 7 /horses/mirette //s3-ap-southeast-2.amazonaws.com/racevic.silk... A.Alexander /trainers/archie-alexander J.Childs ... 0 33.53 11.89 57.0 67.9 63.5 68.5 700m 62.5 3.8
5 $95k yearling by same sire as Pinot out of a s... 6 6th Dark Confidant 3 /horses/dark-confidant //s3-ap-southeast-2.amazonaws.com/racevic.silk... D. & B.Hayes & T.Dabernig /trainers/david-hayes D.Dunn ... +2 33.74 11.91 56.4 67.1 63.3 68.8 700m 61.9 5.0
6 Same sire as Vega Magic out of imported stakes... 7 7th La Celestina 6 /horses/la-celestina //s3-ap-southeast-2.amazonaws.com/racevic.silk... D.R.Brideoake /trainers/david-brideoake D.M.Lane ... +1 34.46 12.27 57.5 67.3 61.4 68.2 700m 61.7 0.8
7 rows × 29 columns
Comment FinalPosition FinalPositionAbbreviation FullName SaddleNumber HorseUrl SilkUrl Trainer TrainerUrl Jockey ... DistanceVarToWinner SixHundredMetresTime TwoHundredMetresTime Early Mid Late OverallPeakSpeed PeakSpeedLocation OverallAvgSpeed DistanceFromRail
0 Game in defeat both runs this campaign. Better... 1 1st Wise Hero 2 /horses/wise-hero //s3-ap-southeast-2.amazonaws.com/racevic.silk... J.W.Price /trainers/john-price S.M.Thornton ... 33.13 11.43 55.4 62.7 65.5 68.2 300m 61.7 0.7
1 Two runs since racing wide over this trip at C... 2 2nd Just Hifalutin 5 /horses/just-hifalutin //s3-ap-southeast-2.amazonaws.com/racevic.silk... E.Jusufovic /trainers/enver-jusufovic L.Currie ... +3 32.75 11.37 53.1 63.8 65.8 68.5 400m 61.7 3.3
2 Did a bit of early work at Seymour and was not... 3 3rd King Kohei 10 /horses/king-kohei //s3-ap-southeast-2.amazonaws.com/racevic.silk... Michael & Luke Cerchi /trainers/mick-cerchi
[...]

Keras --- About Masking Layer followed by a Reshape Layer

I want to using mask before LSTM, but the output of Lstm must be reshape to 4 dim.
So my code:
main_input = Input(shape=(96,1000), name='main_input')
pre_input = BatchNormalization()(main_input)
aaa= Masking(mask_value=0)(pre_input)
recurrent1 = LSTM(256,return_sequences=True)(aaa)
r_out= Reshape((1,96,256))(recurrent1)`
But it runs with error:
[![enter image description here][1]][1]
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-2-d1107015501b> in <module>()
17 recurrent1 = LSTM(256,return_sequences=True)(aaa)
18
---> 19 r_out= Reshape((1,96,256))(recurrent1)
/usr/local/lib/python2.7/dist-packages/keras/engine/topology.pyc in __call__(self, x, mask)
512 if inbound_layers:
513 # this will call layer.build() if necessary
--> 514 self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
515 input_added = True
516
/usr/local/lib/python2.7/dist-packages/keras/engine/topology.pyc in add_inbound_node(self, inbound_layers, node_indices, tensor_indices)
570 # creating the node automatically updates self.inbound_nodes
571 # as well as outbound_nodes on inbound layers.
--> 572 Node.create_node(self, inbound_layers, node_indices, tensor_indices)
573
574 def get_output_shape_for(self, input_shape):
/usr/local/lib/python2.7/dist-packages/keras/engine/topology.pyc in create_node(cls, outbound_layer, inbound_layers, node_indices, tensor_indices)
148 if len(input_tensors) == 1:
149 output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
--> 150 output_masks = to_list(outbound_layer.compute_mask(input_tensors[0], input_masks[0]))
151 # TODO: try to auto-infer shape if exception is raised by get_output_shape_for
152 output_shapes = to_list(outbound_layer.get_output_shape_for(input_shapes[0]))
/usr/local/lib/python2.7/dist-packages/keras/engine/topology.pyc in compute_mask(self, input, input_mask)
605 else:
606 raise Exception('Layer ' + self.name + ' does not support masking, ' +
--> 607 'but was passed an input_mask: ' + str(input_mask))
608 # masking not explicitly supported: return None as mask
609 return None
Exception: Layer reshape_1 does not support masking, but was passed an input_mask: Any{2}.0
I have print out, the outshape of recurrent1 is (96,256)
How could I make it right?

mysql is not up when it was started?

when i am starting up MySQL galera cluster in one of 3 nodes ,it has not yet come up , Below error message was well found from error log
after that i tried to rebuilding my box from another source again we are getting same issue.
stack_bottom = 4cc4b098 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x7d08b5]
/usr/sbin/mysqld(handle_fatal_signal+0x4b4)[0x6a90e4]
/lib64/libpthread.so.0[0x2aec71ffdb10]
/usr/sbin/mysqld[0x5453c7]
/usr/sbin/mysqld[0x545a10]
/usr/sbin/mysqld[0x545ca6]
/usr/sbin/mysqld[0x53d859]
/usr/sbin/mysqld(_Z16acl_authenticateP3THDjj+0x8c0)[0x54ca20]
/usr/sbin/mysqld[0x639a5e]
/usr/sbin/mysqld(_Z16login_connectionP3THD+0x50)[0x639c70]
/usr/sbin/mysqld(_Z22thd_prepare_connectionP3THD+0x2f)[0x639e7f]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x12b)[0x63af1b]
/usr/sbin/mysqld(handle_one_connection+0x51)[0x63b121]
/lib64/libpthread.so.0[0x2aec71ff573d]
/lib64/libc.so.6(clone+0x6d)[0x2aec733460cd]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): Connection ID (thread ID): 18
Status: NOT_KILLED
i was followed below link and recieved preceeding result.
https://dev.mysql.com/doc/refman/5.5/en/using-stack-trace.html
Result
0x40000 (?)
0x7d08b5 my_print_stacktrace + 53
0x6a90e4 handle_fatal_signal + 1204
0x2aec71ffdb10 _end + 1895256184
0x5453c7 _Z7get_mqhPKcS0_P9user_conn + 1527
0x545a10 _Z7get_mqhPKcS0_P9user_conn + 3136
0x545ca6 _Z7get_mqhPKcS0_P9user_conn + 3798
0x53d859 _Z23get_cached_table_accessP22st_grant_internal_infoPKcS2_ + 233
0x54ca20 _Z16acl_authenticateP3THDjj + 2240
0x639a5e _Z30check_for_max_user_connectionsP3THDPK9user_conn + 750
0x639c70 _Z16login_connectionP3THD + 80
0x639e7f _Z22thd_prepare_connectionP3THD + 47
0x63af1b _Z24do_handle_one_connectionP3THD + 299
0x63b121 handle_one_connection + 81
0x2aec71ff573d _end + 1895222437
0x2aec733460cd _end + 1915475509
Please help me how to fix it.
1、In mysql configuration file by adding the following line configuration, try
thread_cache_size=8

iApp raising exception, only in Thai

The iPhone app I am working on is behaving rather normally, up to now.
It supports several languages,but the last one I added (Thai) is giving me trouble.
For some reason it crashes, raising an exception. It seems to happen when I modify the contents of a UITextView, but only in Thai language.
Doing bt in the debug console, I get the trace below.
Can anyone help me make sense of this?
(lldb) bt
* thread #1: tid = 0x1c03, 0x0185ae52 libobjc.A.dylib`objc_exception_throw, stop reason = breakpoint 1.1
frame #0: 0x0185ae52 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0241cdeb CoreFoundation`+[NSException raise:format:] + 139
frame #2: 0x0152ba75 QuartzCore`CA::Layer::set_bounds(CA::Rect const&, bool) + 213
frame #3: 0x0152bd1e QuartzCore`-[CALayer setBounds:] + 154
frame #4: 0x000b8151 UIKit`-[UIView(Geometry) setBounds:] + 336
frame #5: 0x000ca0f8 UIKit`-[UIScrollView setBounds:] + 5493
frame #6: 0x001acb20 UIKit`-[UITextView setBounds:] + 116
frame #7: 0x000ca64d UIKit`-[UIScrollView setContentOffset:] + 728
frame #8: 0x000c66ba UIKit`-[UIScrollViewScrollAnimation setProgress:] + 486
frame #9: 0x0014b0f2 UIKit`-[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] + 339
frame #10: 0x0014ac58 UIKit`-[UIAnimator(Static) _LCDHeartbeatCallback:] + 67
frame #11: 0x015522d2 QuartzCore`CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long) + 110
frame #12: 0x0155275f QuartzCore`CA::Display::TimerDisplayLink::callback(__CFRunLoopTimer*, void*) + 161
frame #13: 0x023dc376 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
frame #14: 0x023dbe06 CoreFoundation`__CFRunLoopDoTimer + 534
frame #15: 0x023c3a82 CoreFoundation`__CFRunLoopRun + 1810
frame #16: 0x023c2f44 CoreFoundation`CFRunLoopRunSpecific + 276
frame #17: 0x023c2e1b CoreFoundation`CFRunLoopRunInMode + 123
frame #18: 0x023777e3 GraphicsServices`GSEventRunModal + 88
frame #19: 0x02377668 GraphicsServices`GSEventRun + 104
frame #20: 0x00072ffc UIKit`UIApplicationMain + 1211
frame #21: 0x0000265d Cahier`main(argc=1, argv=0xbffff37c) + 141 at main.m:16
frame #22: 0x00002585 Cahier`start + 53
(lldb)