Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Rollback to System.loadLibrary to load native library. #368

Merged
merged 2 commits into from
May 7, 2020
Merged

Conversation

Chaoba
Copy link
Contributor

@Chaoba Chaoba commented May 6, 2020

<changelog>Fix loading library failure by rollbacking to System.loadLibrary if SoLoader failed to load the library. </changelog>
Resolves #367

@Chaoba Chaoba requested a review from tobrun May 6, 2020 10:55
@chloekraw
Copy link
Contributor

Oh, this is a nice idea! I was originally thinking that we'd need to do some profiling around Soloader vs the system library, but I think the way this is implemented, it would be safe to cherrypick into release-water and hopefully reduce crash rates. @tobrun, would you agree?

cc @mapbox/maps-android

Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer stripping SoLoader completely and replacing it with System.loadLibrary instead.

+ "call Mapbox.getInstance(Context context, String accessToken) first");
throw new UnsatisfiedLinkError(exception.getMessage());
//Rollback to System.loadLibrary if SoLoader failed to load library.
System.loadLibrary(name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code block won't be hit when SoLoader fails to load (we would hit a UnsatisfiedLinkError not a MapboxConfgurationException)

@Chaoba Chaoba changed the title Rollback to System.loadLibrary if SoLoader failed to load library. Rollback to System.loadLibrary to load native library. May 7, 2020
@Chaoba Chaoba merged commit 01f1b1e into master May 7, 2020
@Chaoba Chaoba deleted the kl-soloader branch May 7, 2020 09:08
Chaoba pushed a commit that referenced this pull request May 7, 2020
* Rollback to System.loadLibrary if SoLoader failed to load library.

* Remove soloader.

(cherry picked from commit 01f1b1e)
Chaoba pushed a commit that referenced this pull request May 7, 2020
* Bump telemetry to 5.0.1, core to 2.0.1 (#370)


(cherry picked from commit 9d5b1f6)

* Rollback to System.loadLibrary to load native library. (#368)

* Rollback to System.loadLibrary if SoLoader failed to load library.

* Remove soloader.

(cherry picked from commit 01f1b1e)

* Update changelog for 9.2.0 (#371)

* Update changelog for 9.2.0

* Update changelog for 9.2.0

* Update changelog for 9.2.0

* Update changelog for 9.2.0

(cherry picked from commit ea7acd6)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate using system library loader
3 participants