Closed Bug 1474859 Opened 6 years ago Closed 6 years ago

Enable Multidex for official flavours

Categories

(Firefox for Android Graveyard :: General, enhancement)

All
Android
enhancement
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
Firefox 63
Tracking Status
firefox63 --- fixed

People

(Reporter: petru, Assigned: petru)

References

(Blocks 1 open bug)

Details

(Whiteboard: --do_not_change--[priority:high])

Attachments

(1 file)

This is a folow-up to bug 1468487 which only enabled Multidex for the _local_ builds.

Multidex will need to also be enabled for _official_ builds when we will get close to that 65.536  number of methods.

Current stats (June 11th 2018):
> Total methods in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk: 62795 (95.82% used)
> Total fields in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk:  38003 (57.99% used)
> Total classes in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk:  7972 (12.16% used)
Assignee: nobody → petru.lingurar
Status: NEW → ASSIGNED
When building with 'MOZ_INSTALL_TRACKING' (for using Adjust)
the number of methods exceed the 64k limit even for _official_ builds
>Total methods in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk: 66609 (101.64% used)
>Total fields in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk:  43648 (66.60% used)
>Total classes in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk:  8710 (13.29% used)
Blocks: 1476271
Whiteboard: --do_not_change--[priority:high]
Attachment #8996688 - Flags: review?(sdaswani) → review?(nalexander)
Those numbers for when building with 'MOZ_INSTALL_TRACKING' which adds
- play-services-analytics
- play-services-basement

 are up from the current

> Total methods in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk: 65149 (99.41% used)
> Total fields in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk:  42643 (65.07% used)
> Total classes in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk:  8661 (13.22% used)
Good lord.  Do we actually need `play-services-analytics` for Adjust?  I really don't want to flip the multiDex switch because it's really hard to test.
(In reply to Nick Alexander :nalexander from comment #4)
> Good lord.  Do we actually need `play-services-analytics` for Adjust?  I
> really don't want to flip the multiDex switch because it's really hard to
> test.

Found that Adjust needs google play services
https://dxr.mozilla.org/mozilla-central/rev/af6a7edf0069549543f2fba6a8ee3ea251b20829/mobile/android/moz.configure#136
and more specifically the analytics library to get the advertising ID, otherwise it would fail to send data.
https://dxr.mozilla.org/mozilla-central/rev/af6a7edf0069549543f2fba6a8ee3ea251b20829/mobile/android/docs/adjust.rst#40
https://bugzilla.mozilla.org/show_bug.cgi?id=1233238#c10
https://bugzilla.mozilla.org/show_bug.cgi?id=1233238#c15
https://bugzilla.mozilla.org/show_bug.cgi?id=1233238#c28
Comment on attachment 8996688 [details]
Bug 1474859 - Enable Multidex for all builds;

https://reviewboard.mozilla.org/r/260768/#review268126

Can you run the following patch through try/nightly-as-beta?  We don't need analytics, we just need the advertising ID.  (Locally, this works, and squeaks under the method count...)

r- for me to revisit.

```
diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -231,17 +231,17 @@ dependencies {
     if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
         implementation "com.android.support:mediarouter-v7:$support_library_version"
         implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
         implementation "com.google.android.gms:play-services-base:$google_play_services_version"
         implementation "com.google.android.gms:play-services-cast:$google_play_services_version"
     }

     if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
-        implementation "com.google.android.gms:play-services-analytics:$google_play_services_version"
+        implementation "com.google.android.gms:play-services-ads-identifier:$google_play_services_version"
         implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
     }

     if (mozconfig.substs.MOZ_ANDROID_GCM) {
         implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
         implementation "com.google.android.gms:play-services-base:$google_play_services_version"
         implementation "com.google.android.gms:play-services-gcm:$google_play_services_version"
     }
```
Attachment #8996688 - Flags: review?(nalexander) → review-
Thanks Nick!

Tried using ads-identifier when building locally but even with this I got 
(needed to enable multidex otherwise the build would fail):
> Total methods in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk: 65563 (100.04% used)
up from the current 
> Total methods in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk: 65149 (99.41% used)
but certainly less than what using analytics ment
> Total methods in app-official-withoutGeckoBinaries-noMinApi-photon-debug.apk: 66609 (101.64% used)


Didn't know how to make a try which would use MOZ_INSTALL_TRACKING or try/nightly-as-beta .
Any indications for this would be highly appreciated.
Comment on attachment 8996688 [details]
Bug 1474859 - Enable Multidex for all builds;

https://reviewboard.mozilla.org/r/260768/#review268280

OK, let's see how multiDex goes in the wild.

Be sure to include the ads-identifer change in this patch, and then bombs away!
Attachment #8996688 - Flags: review- → review+
Keywords: checkin-needed
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/90b75c88d208
Enable Multidex for all builds; r=nalexander
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/90b75c88d208
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: