Google maps is not showing on Xcode simulator. I've tried it on my actual iPhone however and it works just fine. I then followed this query up apple developer support however, they mentioned that they were unable to help as I initially thought it may have been a simulator issue.
Can anyone advise as to what the issue could be?
The google markers are all showing but just the map view itself shows up blank. Ive tried disabling and re-enabling the Google Maps SDK on the google api console. I've even tried creating new API keys to use but this did not change.
PS. This never used to be an issue before Xcode 9.
Screenshot of Xcode simulator
Here is a snippet of code that I've used to add Google maps to the application:
- (void)viewDidLoad {
[super viewDidLoad];
_mkap=[[GMSMapView alloc]initWithFrame:_mapView.bounds];
_mkap.myLocationEnabled = YES;
_mkap.delegate=self;
NSError *error;
NSURL *url1 =[[NSBundle mainBundle] URLForResource:#"map_white" withExtension:#"json"];
GMSMapStyle *style = [GMSMapStyle styleWithContentsOfFileURL:url1 error:&error];
if (!style) {
NSLog(#"The style definition could not be loaded: %#", error);
}
_mkap.mapStyle = style;
[_mapView addSubview:_mkap];
_arrayPolylineGreen = [[NSMutableArray alloc] init];
}
Not sure if this is a scenario you are in. I faced the same issue with google maps displayed as a gray box in the IOS simulator.
The root cause was the netskope client running in my mac. Once that was disabled, maps started showing streets and roads.
Netskope client details - https://docs.netskope.com/en/netskope-client.html
Related
I have an app that uses Admob. But since I am supporting versions of iOS 5 and above, I make sure that I don't call Admob code in versions below iOS 6 by doing the following:
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_5_1) {
int j = 2;
j++; //This is just some code so I can use breakpoints for testing.
NSLog(#"Google Mobile Ads SDK version: %#", [GADRequest sdkVersion]); //Commenting out the line prevents the crash
}
I am testing on iOS 5.1.1. Now if I comment out the NSLog, line, the app works without problem. But if I uncomment it the app crashes almost immediately within the main method:
int retVal = UIApplicationMain(argc, argv, nil, #"AppController");
I guess its not crashing when it is commented out because the compiler "optimises out" the code since its not used. But then what is the correct way to make sure the code isn't used, and the app doesn't crash ?
EDIT: I edited the code, the if block is not optimised out:
int j = 2;
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_5_1) {
j++; //This is just some code so I can use breakpoints for testing.
NSLog(#"Google Mobile Ads SDK version: %#", [GADRequest sdkVersion]); //Commenting out the line prevents the crash
}else{
j--;
}
NSLog(#"%d",j);
The output is "1", so the code in the else block executes. So even thought the function call [GADRequest sdkVersion] is not made, why does it crash ? Again, if I comment out the function call the app does not crash.
One possibility that is consistent with what you're describing is that linking to AdMob causes the crash. Sending a message to the GADRequest class in your code causes it to link to the GADRequest class, whereas if you didn't, it wouldn't link to it.
Why does linking to AdMob cause the crash? Most likely it's because AdMob links to several system frameworks, some of which may not exist on iOS 5 (e.g. AdSupport framework), so when it tries to dynamically link to them on app startup, the dynamic linker crashes.
I'm not sure what you can do. Maybe you can try explicitly linking to the system frameworks that AdMob use as "optional" in Xcode? (I haven't tested it.)
Otherwise, you could downgrade to a version of AdMob that supports iOS 5 (according to the release notes, any version before 7 should do).
I dont know why it crashes - but don't support iOS 5. It is pointless. The iOS market split is something like 20% iOS7, 80% iOS8. You cannot buy iOS5 phones, and you cannot install or, or even release apps for it.
I have an iOS app designed in PhoneGap. The problem is that the app is crashing during my navigation through it. The app is quite big with lots of videos, but sadly I am unable to locate what instigates the error.
What I did was:
Safari iPad Inspect element. There are no errors there. I have removed all of them but app still crashes without any warning.
As mentioned here, I created error.html and added these lines in MainViewController.m:
(void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
{
[theWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:#"error" ofType:#"html" inDirectory:#"www"] isDirectory:NO]]];
}
Unfortunately, neither approach worked. Any idea what direction should I go?
You can use an error tracking service that tracks JavaScript errors to get information on your errors.
Atatus is one such service, that works with Cordova/PhoneGap.
in my project i call this function: (Facebook SDK for iOS version v4.1.0)
FBSDKGameRequestContent *gameRequestContent = [[FBSDKGameRequestContent alloc] init];
gameRequestContent.message = #"Choi thu nhe, hay lam day";
gameRequestContent.title = #"Monkey Junior";
gameRequestContent.to = friends;
dialog = [FBSDKGameRequestDialog showWithContent:gameRequestContent delegate:(id)self];
Image:
Our app is in landscape and the Facebook friend invite dialog is in portrait and the buttons Send and Cancel are located outside the screen.
Please help me.
This is a known issue with the FB SDK for iOS being tracked here.
This issue is seen in iOS 7.x so if it is blocking you then you can maybe at least test your functionality (if feasible) in iOS 8.x till the fix is released.
I've got a very simple test app which contains nothing but the following code, attached to a UIButton:
- (IBAction)buttonUp:(id)sender {
// Build file path
NSString* filePath = [[NSBundle mainBundle] pathForResource:#"testfile"
ofType:#"txt"];
NSURL *url = [NSURL fileURLWithPath:filePath];
m_interactionController = [UIDocumentInteractionController interactionControllerWithURL:url];
[m_interactionController presentOptionsMenuFromRect:CGRectMake(200, 200, 100, 100)
inView:[self view]
animated:YES];
}
This builds with no issues, and running under iOS 7 (on a 4th generation iPad: A1458), this code works fine.
The problem is that, in iOS 8 Beta 5, if the user selects "Mail" from the UIDocumentInteractionController, then the email sheet that is displayed can never be dismissed. Tapping Send does indeed send the mail, but the email sheet continues to be displayed. Tapping on Cancel and electing to either delete or save the draft has no effect.
The problem occurs when the test app is built using Xcode 5.1.1. However, if the app is built with the Xcode 6 GM, then problem does not occur, and the code works fine.
Is there anything wrong with the code above?
For us, the problem did not occur in the final released version of iOS 8.
I had posted it to Radar, and it was closed as a duplicate (with the status of the duplicate being "Open"), so presumably it was a bug in the prerelease versions of iOS 8.
Hi I'm trying to a share images using sharekit on twitter,from app. I have added a twitter icon and when clicked I call this function
-(void)shareTwitter
{
SHKItem *itemshare = [SHKItem image:imgView.image title:projectname];
[SHK setRootViewController:self.navigationController];
[SHKTwitter shareItem:itemshare];
}
after this function is executed the app crashes saying exec_bad_access in sharekit code.
I have added the piece of line below where it occurs.
iOS5twitter.completionHandler = ^(TWTweetComposeViewControllerResult result) ;
I tried to reproduce the same issue with the demoapp provided by sharekit.The app runs fine and even posts image.
The crash appears before login authentication. can someone guide me thru this and help me fix this issue
thanks