My project is working perfectly on any iphone, but when I try to run it on any ipad model I get the following error while defining the mapView.
var mapView = NMAMapView() ---> EXC_BAD_ACCESS (code=1, address=0x18)
Edit: Device is ipadPro 10.5, iOS v12.1, HEREMaps (3.9.0) installed with cocoapods, tried both on simulator and real device.
This is not a "real" solution but it has solved the same issue for me.
In my project's scheme there was a specific "Application Language" selected because I was debugging it.
Removing this setting, the NMAMapView starts working again.
I think that it's related to the Permission Location Access alert, but it's not reproducible bug (I tried with an empty project and in that case it doesn't happen)
UPDATE
I resolved. In my case was related to Location Access authorizations. In certain situations my NMAPView was instatiated before asking the authorization for Location Access and this caused the crash.
Related
After working just fine on both iPhone and iPad for a month, my Xcode 9 app has consistently started crashing causing me the following fatal problem: When I build & run it on an iPhone (simulator or device) Xcode completes loading the app and then crashes too fast for me to copy/paste the error from the debugger. When I run on iPad it works fine leading me to believe this is a result of something related to the split master/detail view.
If I use either an exception breakpoint or an "all C++ exceptions" it will stop at the AppDelegate class and crash if I hit play. If I use only an "all Objective-C exceptions" it will crash as before.
In the debug view hierarchy I get the following errors as well:
Error: Unable to capture view hierarchy.
Details: Log Title: Data source expression execution failure.
Log Details: error evaluating expression “(id)
[[(Class)objc_getClass("DBGTargetHub") sharedHub]
performRequestWithRequestInBase64:#"...
Log Method: -[DBGDataSourceConnectionLibViewDebugger
_executeLLDBExpression:forRequest:onPotentialThread:iteration:]
_block_invoke_2
Method: -[DBGViewDebugger updateDebugHierarchy]_block_invoke_2
I have tested other apps and this issue is unique to the app I am working on. Any ideas or debugging tips for how to proceed? I might just have to redo this whole project again if I can't even find the root cause of this! Appreciate any help.
Quick solution: Reset Simulator Device
I managed to resolve the above issue thanks to some serious digging. First, to resolve the instantaneous crash problem, I set a breakpoint at every line in the app delegate. That allowed me to narrow the error to a memory handling problem. From there I started running the code on one of each device available, and realized the crash only occurred on devices I had used earlier in development. Resetting those devices solved the problem.
The core issue here is that when you clean/rebuild your xcode program, it updates the app code on the device, but not necessarily the data model information. So when I changed my data model by including new data and renaming old data it was not properly updated.
In my iOS app crash log I found this statement:
HW kbd Failed to set (null) as keyboard focus ios
Does anyone know what is this and how to resolve it?
I've just encountered this exception running a Xamarin app on the simulator. It started occurring after I toggled the software keyboard off while debugging the app. Given the exception mentioning the keyboard I think that's what caused it.
Uninstalling the app from the emulator, cleaning and rebuilding fixed the issue for me.
Unsure if this bug is on Apple's side or Xamarin's.
The only references I could find related to Xamarin was close, but the inverse of this - the app crashing on the simulator, but working on an actual device. The resolution in that forum post doesn't describe what the problem might be, but does suggest that cleaning the project and rebuilding may resolve it.
The specific message HW kbd Failed to set (null) as keyboard focus ios is related to the app crashing, but there's no additional information in the pastebin to really help pin down why it's crashing.
You might also consider adding logging statements in your code to see if you can isolate the issue.
I have 2 projects working with google maps sdk, they are currently in the Appstore.
Things to have in mind:
Gmaps sdk version 1.9.0 installed via cocoapods
Xcode version 6.4
Deployment target 7.1
Device: iPhone 4s with 8.3.0
Today I've opened Xcode as usual with the first project, tried to compile and debug on the iPhone and I sometimes get a EXC_BAD_ACCESS (code=1...) crash on the app and sometime get EXC_BAD_ACCESS (code=EXC_ARM_DA_ALING...), no stack trace in here, but always on main.m:
return UIApplicationMain(argc, argv, nil, NSStringFromClass([TGPAppDelegate class]));
Seeing the first thread I've discovered that this is error is related to google maps:
Tried the following:
Updating the pod (didn't work)
Replaced my code with the sample code on gmaps sdk page (didn't work)*
I have read something about auto layout, disabled (didn't work)
The weird part is that I also:
Tried in an iPhone 6 with 8.4 (DID work)
Tried in an iPhone 6 with 8.3 (DID work)
Both project are in an early beta state, so I don't if the are any real user have this problem but I'm worried that some users wont be able to use the apps because of this.
I couldn't find too much information over the internet and I don't even know where to look, is there any reported known error regarding this?, anyone else with the same issue?
Here is the sample code I'm using:
-(void)viewDidLoad {
[super viewDidLoad];
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:37.80948
longitude:5.965699
zoom:2];
GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
self.view = mapView;
}
EDIT 1:
Doing more tests, found out that the problem appears only when debugging (attaching the debugger when running the app), if you run the app from the iPhone and after that you attach the debugger to the process, everything runs ok, I mean, if the map tries to render when the debugger is attached then you will get the exc_bad_access, it's a debugger error then?, I'm confused
EDIT 2:
This in answered in here , thanks Dave
The answer to this is not mine, this in answered in here , thanks Dave, I' m just quoting him so anyone can see the answer.
I've found the root of the problem and have a workaround:
The problem seems to be triggered by OpenGL ES Frame Capture in XCode;
I'm guessing this problem started when Apple added Metal to the mix as
of XCode 6.4/iOS 8.3, perhaps somehow adversely affecting the entire
frame capture debugging system.
The workaround:
EDIT: I've found the root of the problem and have a workaround:
The problem seems to be triggered by OpenGL ES Frame Capture in XCode;
I'm guessing this problem started when Apple added Metal to the mix as
of XCode 6.4/iOS 8.3, perhaps somehow adversely affecting the entire
frame capture debugging system.
The workaround:
In XCode, go to Product > Scheme > Edit Scheme...
Select the "Run" Tab on the left.
Select the "Options" sub-tab on the top.
Change "GPU Frame Capture" from "Automatically Enabled" or "OpenGL ES" to either "Metal" or "Disabled".
This disables OpenGL ES frame capture, which isn't great, but allows
you to continue debugging your builds.
Not sure if this issue is Apple's or Google's but I'll be posting bug
reports to both. Happy coding!
Same problem here with MKMapView.
Solution is rollback to (run side-by-side) Xcode 6.3.2.
http://adcdownload.apple.com/Developer_Tools/Xcode_6.3.2/Xcode_6.3.2.dmg
Also switch Command Line Tools to 6.3.2 in Preference -> Locations
i had the exact same problem:
iphone 4 -> iOs 7 (working)
xcode simulator (working)
iphone 5s -> iOs 8.3 (NOT working EXC_BAD_ACCESS)
SOLUTION: i updated my iphone to iOs 8.4 and the problem is gone, maps are loading.
hope it helps
This is driving me crazy...
I have been using Google Maps SDK for iOS for a while (even in an App Store product).
Now, I cannot make it run in the iOS simulator any longer! It doesn't matter which project I try to run (even the sample code from the SDK), it will always crash the first time a map is added, e.g.:
self.view = [GMSMapView mapWithFrame: frame camera: camera];
This is the log messages I get:
2013-05-16 10:59:01.047 SDKDemos[939:1303] ADDRESPONSE - ADDING TO MEMORY ONLY: http://dl.google.com/geosdk/latest
2013-05-16 10:59:01.050 SDKDemos[939:1b03] Google Maps SDK for iOS version: 1.2.2.3031
2013-05-16 10:59:01.050 SDKDemos[939:1b03] New version of Google Maps SDK for iOS available: 1.3.0.3430
2013-05-16 10:59:01.111 SDKDemos[939:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
I have lately tried an antivirus SW on this mac, so one theory is that it may have blocked some vital Google Maps data from downloading. Now, I have uninstalled this anti-virus SW, removed Xcode's DerivedData and reset the iOS Simulator, but with the same disappointing result.
All projects I have tried are working perfectly fine when I run them on my iPhone. I have also another mac where everything works fine on the simulator. So clearly something must have happened with this particular machine.
Any advice?
Update
Initially, I focused entirely on the first warning message (ADDRESPONSE - ADDING TO MEMORY ONLY: http://dl.google.com/geosdk/latest), but I have now realised that the only purpose of the URL mentioned there is to download a string with the latest SDK version number (currently "1.3.0.3430"). Since the SDK then correctly prints that string two lines further down, I find it very unlikely that this line is related to the real cause of the crash. (I have changed the title of this question accordingly.)
Hard to say if this really qualifies as an answer...
In any case, I'd like to document the outcome of this, in case someone else stumbles upon the same problem in the future:
After having been away a couple of days, I returned today, turned on my iMac, made a new test run, and...
The problem was gone!
Everything just worked as expected!
I have not changed a single line of code or anything at all in the Xcode configuration.
The only thing I did was to once again delete Xcode's DerivedData and reset the simulator (which I did numerous times last week, but without success at that time).
I guess that my assumption must have been right, that there must have been a cache somewhere in my machine, but outside Xcode´s DerivedData, that caused this problem. Then I was away a couple of days, and this cache simply timed out!
Even if this may sound a bit far-fetched, I cannot think of another reason for this weird behaviour.
It would have been really useful to know where this cache is located, so that one could clean it up without needing to shut down the mac for some days!
I have an app I'm developing where setting a breakpoint in Xcode while the app is running causes it to crash. At least I assume it is a crash. There is nothing in the console saying what happened. The app just terminates.
Note that the break point is not being hit, just the act of setting it causes this.
I've developed many apps and this is the first to act like this. Does anyone have any ideas what could be happening or how to figure this out? It is really slowing down my debugging.
I'm assuming you're using Xcode 4.x. Try going into your scheme's settings and switch to a different debugger (GDB if you have LLDB currently set, or vice versa).
If that doesn't work, we need more info:
which version of Xcode and iOS are you using?
does the problem occur in the Simulator or on your device, or both?
have you tried placing a breakpoint in different places in your code?
As far as I can tell, it's a debugger issue. So your app does not actually crash, it's the debug session that crashes which causes the app to terminate. You can observe a similar effect when you hit Stop in Xcode or disconnect your device while an app is attached to the debugger in Xcode.
Might be an issue with mismatching Xcode and iOS versions. Please provide more info about your environment to help diagnose the problem.