Compiler error: Invalid library file - CoreLocation
Asked Answered
C

8

38

I have one of my application, that is created in Xcode 8. I have used CoreLocation and MapKit in that app.

I have update app with latest iOS till now. and it was working fine. Now I am updating application with iOS 1. So I hvae opened app with Xcode 11.0 and updated all the required code. Also updated setting that is suggested by Xcode "Perform Changes" and all that.

Now I run application, but I am getting error like :

Compiler error: Invalid library file.

I have searched lot, but can't find any solution. Is this a bug in new Xcode or new iOS ?

Is there anything I have to do extra changes or settings ? Please guide me. Is this known bug by Apple ?

EDIT :

2019-10-18 10:34:39.899827+0530 MapLocation[1697:57778] Compiler error: Invalid library file 2019-10-18 10:34:39.900098+0530 MapLocation[1697:57778] Compiler error: Invalid library file 2019-10-18 10:34:39.915973+0530 MapLocation[1697:57778] Compiler error: Invalid library file 2019-10-18 10:34:39.916228+0530 MapLocation[1697:57778] Compiler error: Invalid library file

2019-10-18 10:34:39.920608+0530 MapLocation[1697:57778] Updated coordinate are : <+23.02055700,+72.50524900> +/- 5.00m (speed -1.00 mps / course -1.00) @ 10/18/19, 10:34:39 AM India Standard Time

2019-10-18 10:34:39.920697+0530 MapLocation[1697:57778] Latitude:- 23.0206, Longitude:- 72.5052

2019-10-18 10:34:39.925441+0530 MapLocation[1697:57778] Entering in ----> (Latitude:- 23.0206, Longitude:- 72.5052), With Radius:- 300.00

2019-10-18 10:34:39.925546+0530 MapLocation[1697:57778] Stated in ----> (Latitude:- 23.0206, Longitude:- 72.5052), With Radius:- 300.00

2019-10-18 10:34:39.926582+0530 MapLocation[1697:57778] Exit from ----> (Latitude:- 23.0021, Longitude:- 72.4995), With Radius:- 300.00

2019-10-18 10:34:39.926683+0530 MapLocation[1697:57778] Stated in ----> (Latitude:- 23.0021, Longitude:- 72.4995), With Radius:- 300.00

2019-10-18 10:34:39.932080+0530 MapLocation[1697:57778] Compiler error: Invalid library file 2019-10-18 10:34:39.932268+0530 MapLocation[1697:57778] Compiler error: Invalid library file 2019-10-18 10:34:39.948942+0530 MapLocation[1697:57778] Compiler error: Invalid library file 2019-10-18 10:34:39.949220+0530 MapLocation[1697:57778] Compiler error: Invalid library file

Calvo answered 18/10, 2019 at 6:27 Comment(2)
Guessing from your other tags this is about the Swift compiler? Compiler errors are very dependent on compiler and language, so in the future don't forget to add that information.Preeminent
I have tried in Objective C, by writing new programme. But same...Calvo
R
33

I'm seeing this issue also. It only happens if you implement the renderFor overlay for MKMapView. And without this function, I can't display the polyline that I'm adding to the mapView. This was working fine in Xcode 10.

Romona answered 18/10, 2019 at 19:59 Comment(6)
I've the same issue, when I make a Circle overlay on the map. Moreover, this line is printed, when I move the map.Egarton
Issue still here in April 2020.Succulent
still open on 19 July 2020. XCode 11.6.Annettaannette
Same here, with Xcode 13 and iOS 15 SDK...Oread
Still exists in Xcode 13.2Handgrip
Still exists in Xcode 13.4 RCFontana
U
19

Hope this will be fixed in the next version of xcode. But this only happens on the simulator. Use your real device for testing for now..

Unicameral answered 31/10, 2019 at 16:50 Comment(1)
True, running in the real device do not show such error in console.Squishy
I
3

For me what works is to disable OS Activity Logging.

Add the Environment Variable: OS_ACTIVITY_MODE with value: disable on Product > Scheme > Edit Scheme > Run > Arguments.

Xcode environment variables with OS_ACTIVITY_MODE disabled

Warning

Folks have reported that other useful logs for them have also been silenced.


Taken from a similar answer I gave regarding WKWebView, but reposting here for visibility after finding the logging noise appears also with MKMapView.

Inconsumable answered 7/5, 2022 at 11:18 Comment(0)
R
1

I started running into this error recently and was able to get it to go away by clearing the Simulator from Hardware->Erase All Content and Settings... menu item.

Receptor answered 17/2, 2020 at 0:16 Comment(0)
D
1

I worked around this by using SwiftLog to log my messages, putting some unique string inside the tag of each logger (could just be com.yourcompany.yourapp to differentiate it), and then filtering to messages which contain that tag on the console.

A more general solution would be to have a negative filter inside the console view, which would obviate the need to use the logger in this way.

Diversification answered 28/4, 2020 at 6:31 Comment(0)
U
1

I've got the problem too, trying to update multiple polylines coordinates.

The problem was coming, in fact, from the way new coordinates were pushed into the array containing the polylines coordinates (which is a property of a model object in my case).

To get the problem, i was just pushing new coordinates into that array.

To solve the problem, I had to clone that array first in a new var, then add the new coordinate into the cloned array and update the model property.

Before, i was doing :

existingArray.push(object);

Now, I am doing :

var newArray = [...existingArray];

newArray.push(object);

existingArray = newArray;

Hope it can help !

Ursa answered 20/5, 2020 at 15:57 Comment(2)
How does this code relate to the MKPolyline object or whatever MapKit object you are using?Nnw
I had the same compiler error, trying to manipulate polylines as you do but the real problem was coming from the way data was loaded into memory (state). Once I changed the way my arrays were updated, the compiler error went away.Ursa
B
1

For those of you experiencing this error with IOS 15, take a look at a helpful article on raywenderlich that says the error can be safely ignored:

Note: If you’re running on the Simulator, you’re likely to see a plethora of errors of the form Compiler error: Invalid library file in the Xcode console. This is a simulator bug and can safely be ignored. Unfortunately, it makes the console rather noisy, making it more difficult to see the results of your print statements.

You may want to do some more research to confirm this for yourself, but raywenderlich has never lead me astray.

Bluegrass answered 28/4, 2022 at 16:46 Comment(0)
M
0

For me, this only happens when I have Traffic turned on for the map.

enter image description here

I leave the feature on but turn it off in the simulator:

@IBOutlet
var mapView: MKMapView? {
    didSet {
        #if targetEnvironment(simulator)
        mapView?.showsTraffic = false
        #endif
    }
}
Miraculous answered 30/7, 2020 at 15:42 Comment(1)
No, that's not it.Conrado

© 2022 - 2024 — McMap. All rights reserved.