-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix(MM-62375): OOM on gif #8573
base: main
Are you sure you want to change the base?
Conversation
+ implementation project(':frameanimation') | ||
+ implementation project(':gif') | ||
+ implementation("com.github.penfeizhou.android.animation:glide-plugin:3.0.2") { | ||
+ exclude group: 'com.github.penfeizhou.android.animation', module: 'frameanimation' | ||
+ exclude group: 'com.github.penfeizhou.android.animation', module: 'gif' | ||
+ } |
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.
The fixes are in frameanimation & gif.
Now in this PR (that will not get merged).
scripts/postinstall.sh
Outdated
APNG4Android="node_modules/APNG4Android" | ||
if [ ! -z "$APNG4Android" ]; then | ||
git clone -b "fix/MM-62375-oom-on-gif" --single-branch https://github.com/rahimrahman/APNG4Android.git "$APNG4Android"; | ||
fi |
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.
Can't do npm i
since APNG4Android doesn't have package.json.
- TODO: will replace with mattermost/APNG4Android (as soon as permission to write is granted)
- TODO: figure out if I can use SHA instead of branch.
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.
No you cannot clone a specific commit, but you can clone the branch and then do a checkout
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.
You could also use --depth=1 so that it only clones the latest one
include ':frameanimation' | ||
project(':frameanimation').projectDir = new File('../node_modules/APNG4Android/frameanimation') | ||
include ':gif' | ||
project(':gif').projectDir = new File('../node_modules/APNG4Android/gif') |
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.
In order to get this as project in expo-image/android/build.gradle, need to declare frameanimation
and gif
here.
+ exclude group: 'com.github.penfeizhou.android.animation', module: 'frameanimation' | ||
+ exclude group: 'com.github.penfeizhou.android.animation', module: 'gif' |
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.
Without exclusions, it will cause duplicate symbols error. Since glide-plugin will have frameanimation (required module) in other modules (apng, webp, etc).
run: | | ||
echo "::group::clone-APNG4Android" | ||
if [ ! -d "$APNG4Android" ]; then | ||
git clone -b "fix/MM-62375-oom-on-gif" --single-branch https://github.com/rahimrahman/APNG4Android.git "$APNG4Android"; |
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.
Is there any benefit of putting it into node_modules instead of a custom folder on the root path of the app?
- TODO: Will replace this with the correct repo (mattermost/APNG4Android)
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.
Irrelevant in my opinion, but of it works here no need to change
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.
I like node_modules because it's easier to do the npm run clean
and it'll auto-clean this library as well. But I could also have added an extra line to clean the folder wherever it might be in scripts/clean.sh as well.
I'll stick with node_modules.
@@ -54,7 +54,7 @@ | |||
"expo-application": "6.0.1", | |||
"expo-crypto": "14.0.1", | |||
"expo-device": "7.0.1", | |||
"expo-image": "2.0.3", | |||
"expo-image": "2.0.4", |
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.
Any reason to bump this? Just curious
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.
I made a mistake when reading the changelog. And looking at the changes, I thought the addition of try..catch was going to help, but it didn't. Looking deeper, I noticed that it was already implemented in 2.0.3, not a new change in 2.0.4.
Changelog for 2.0.4:
## 2.0.4 — 2025-01-10
_This version does not introduce any user-facing changes._
So it's pretty moot.
scripts/postinstall.sh
Outdated
APNG4Android="node_modules/APNG4Android" | ||
if [ ! -z "$APNG4Android" ]; then | ||
git clone -b "fix/MM-62375-oom-on-gif" --single-branch https://github.com/rahimrahman/APNG4Android.git "$APNG4Android"; | ||
fi |
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.
No you cannot clone a specific commit, but you can clone the branch and then do a checkout
scripts/postinstall.sh
Outdated
APNG4Android="node_modules/APNG4Android" | ||
if [ ! -z "$APNG4Android" ]; then | ||
git clone -b "fix/MM-62375-oom-on-gif" --single-branch https://github.com/rahimrahman/APNG4Android.git "$APNG4Android"; | ||
fi |
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.
You could also use --depth=1 so that it only clones the latest one
@yasserfaraazkhan I'm flagging you for QA review, but @enzowritescode has done the test with his Android device and ✅ it in our private DM. You're welcome to test this as well for redundancy. |
Summary
Ticket Link
Fixes: https://mattermost.atlassian.net/browse/MM-62375
See changes in my own fork of APNG4Android (until I have permission to post to mattermost/APNG4Android): rahimrahman/APNG4Android@74dd31c
Checklist
E2E iOS tests for PR
.Device Information
This PR was tested on:
Google Pixel 6a, Android 14
Screenshots
Release Note