-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for app bundle #26
Conversation
Previous versions didn't work on pre-lollipop devices. I've fixed it. |
Thanks for the PR. This looks good to me, but I'm not the best person to review this. I'll try to find someone internally. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@passy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
Log.d(TAG, "adding backup sources from split apks"); | ||
int splitIndex = 0; | ||
for (String splitApkDir : context.getApplicationInfo().splitSourceDirs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splitSourceDirs may be null in some cases so I suggest to add a necessary check here.
So does aosp in its sources. e.g https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/app/LoadedApk.java#L955
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Fixed
@nesterov-n has updated the pull request. Re-import the pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@passy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Is there an approximate ETA on when this fix will be included in In the meantime, @nesterov-n, would you be so kind as to publish another version of your patched module, which includes 1a044bd? Thank you in advance, and sorry for the trouble 🙇 |
@mannodermaus Sorry, I can't give you any estimates. I would recommend using a patched version in the meantime or @nesterov-n's published artifact. |
For whatever it's worth, we're also impacted by this. We use Fresco, which uses SoLoader, and we can't use AABs until this is solved or we build our own version of Fresco that uses @nesterov-n 's version of SoLoader. |
@mannodermaus I've published the new version of patched-soloader that includes 1a044bd. You can check it with |
@beatrizz, while waiting for the official update to SoLoader, will @nesterov-n's workaround work for you? You exclude Fresco's transitive dependency on SoLoader, then add the patched artifact instead. |
@nesterov-n, thank you for the fix.
Could you please publish |
@YuriDenison Done. You can check it |
You don't have to build your own version of Fresco. All you need to make Fresco works with app bundle is adding these lines in your
That's all. We have already tested it on production. Works well. |
Thanks @mannodermaus and @nesterov-n ! I didn't know you could just change the library like that. |
Only noticed this issue when upgrading to Android Gradle Plugin (AGP) 3.3. We are currently working around the issue by building bundle with AGP 3.2. |
PR is related to #19
Problem
SoLoader cannot load
.so
libraries when an application is installed through App Bundle with config:The reason is that app bundle installation consists of multiple apks. For instance:
base.apk
split_config.arm64_v8a.apk
split_config.xxxhdpi.apk
SoLoader
class createsApkSoSource
pointing only tobase.apk
. But*.so
files exist only insplit_config.arm64_v8a.apk
Solution
Create separate
ApkSoSource
for each apk in the application folder. I couldn't figure out how to filter out apk without lib folder.Testing
I haven't tried this with dynamic feature modules yet. So I can't say that it fully fixes #19. But at least it fixes facebook/fresco#2253
Any help with dynamic modules testing would be much appreciated.
P.S.
Due to some reasons, I can't wait for the new release of SoLoader lib, so I have published a temporary patched version to bintray in my account
with different grouipId
com.avito.android:patched-soloader:0.1.0
If you are against publishing your lib in a different account, please let me know. I'll remove my version immediately.