Skip to content

Conversation

@samer-stripe
Copy link
Collaborator

Summary

Upgrade min SDK version to 24

Motivation

Google is moving various libraries that we depend and don't depend to have a minimum SDK version of 23. Upgrading to have a minimum of 24 loses us around 1.4% of overall Android device support.

Testing

  • Added tests
  • Modified tests
  • Manually verified

@samer-stripe
Copy link
Collaborator Author

We could also just set the minimum to 23 or go higher if we want.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V2)

          │              compressed              │            uncompressed            
          ├─────────────┬───────────┬────────────┼───────────┬───────────┬────────────
 APK      │ old         │ new       │ diff       │ old       │ new       │ diff       
──────────┼─────────────┼───────────┼────────────┼───────────┼───────────┼────────────
      dex │     4.9 MiB │   4.8 MiB │  -87.1 KiB │    11 MiB │  10.8 MiB │ -201.5 KiB 
     arsc │     3.6 MiB │   3.5 MiB │  -31.6 KiB │   3.6 MiB │   3.5 MiB │  -31.6 KiB 
 manifest │     5.7 KiB │   5.7 KiB │       +5 B │  30.2 KiB │  30.2 KiB │        0 B 
      res │ 1,004.4 KiB │ 979.3 KiB │    -25 KiB │   1.7 MiB │   1.6 MiB │  -61.5 KiB 
   native │   949.9 KiB │   2.5 MiB │   +1.5 MiB │   2.5 MiB │   2.5 MiB │        0 B 
    asset │    26.2 KiB │  25.5 KiB │     -710 B │  46.8 KiB │  46.1 KiB │     -710 B 
    other │   205.3 KiB │  92.2 KiB │ -113.2 KiB │ 405.7 KiB │ 149.8 KiB │ -255.9 KiB 
──────────┼─────────────┼───────────┼────────────┼───────────┼───────────┼────────────
    total │    10.6 MiB │  11.9 MiB │   +1.3 MiB │  19.1 MiB │  18.6 MiB │ -551.2 KiB 

         │          raw          │                unique                 
         ├───────┬───────┬───────┼───────┬───────┬───────────────────────
 DEX     │ old   │ new   │ diff  │ old   │ new   │ diff                  
─────────┼───────┼───────┼───────┼───────┼───────┼───────────────────────
   files │     2 │     2 │     0 │       │       │                       
 strings │ 58572 │ 56761 │ -1811 │ 52011 │ 51786 │  -225 (+7045 -7270)   
   types │ 20717 │ 19970 │  -747 │ 17443 │ 17352 │   -91 (+7036 -7127)   
 classes │ 14668 │ 14627 │   -41 │ 14668 │ 14627 │   -41 (+5903 -5944)   
 methods │ 78320 │ 75718 │ -2602 │ 73280 │ 71841 │ -1439 (+42914 -44353) 
  fields │ 51327 │ 50697 │  -630 │ 48974 │ 48828 │  -146 (+33355 -33501) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  325 │  317 │ -8 (+0 -8) 
 entries │ 6939 │ 6937 │ -2 (+0 -2)
APK
       compressed       │      uncompressed      │                                                              
───────────┬────────────┼───────────┬────────────┤                                                              
 size      │ diff       │ size      │ diff       │ path                                                         
───────────┼────────────┼───────────┼────────────┼──────────────────────────────────────────────────────────────
 665.2 KiB │ +438.2 KiB │ 665.1 KiB │        0 B │ ∆ lib/arm64-v8a/libsentry.so                                 
 678.2 KiB │ +426.5 KiB │ 678.1 KiB │        0 B │ ∆ lib/x86/libsentry.so                                       
 652.7 KiB │ +422.2 KiB │ 652.6 KiB │        0 B │ ∆ lib/x86_64/libsentry.so                                    
 430.1 KiB │ +229.5 KiB │   430 KiB │        0 B │ ∆ lib/armeabi-v7a/libsentry.so                               
 587.4 KiB │ -228.5 KiB │   1.3 MiB │   -522 KiB │ ∆ classes2.dex                                               
   4.2 MiB │ +141.4 KiB │   9.5 MiB │ +320.5 KiB │ ∆ classes.dex                                                
           │  -57.6 KiB │           │ -127.4 KiB │ - META-INF/CERT.SF                                           
           │  -54.4 KiB │           │ -127.3 KiB │ - META-INF/MANIFEST.MF                                       
   3.5 MiB │  -31.6 KiB │   3.5 MiB │  -31.6 KiB │ ∆ resources.arsc                                             
  16.6 KiB │    +11 KiB │  16.4 KiB │        0 B │ ∆ lib/arm64-v8a/libsentry-android.so                         
  16.1 KiB │  +10.5 KiB │    16 KiB │        0 B │ ∆ lib/x86_64/libsentry-android.so                            
  14.5 KiB │   +8.7 KiB │  14.4 KiB │        0 B │ ∆ lib/x86/libsentry-android.so                               
  11.9 KiB │   +6.9 KiB │  11.8 KiB │        0 B │ ∆ lib/armeabi-v7a/libsentry-android.so                       
  10.7 KiB │     +6 KiB │  10.5 KiB │        0 B │ ∆ lib/x86_64/libandroidx.graphics.path.so                    
    10 KiB │   +5.6 KiB │   9.9 KiB │        0 B │ ∆ lib/arm64-v8a/libandroidx.graphics.path.so                 
   9.2 KiB │   +4.4 KiB │   9.1 KiB │        0 B │ ∆ lib/x86/libandroidx.graphics.path.so                       
   7.2 KiB │   +3.1 KiB │   7.1 KiB │        0 B │ ∆ lib/armeabi-v7a/libandroidx.graphics.path.so               
           │   -1.8 KiB │           │   -4.8 KiB │ - res/oi.xml                                                 
           │   -1.7 KiB │           │     -7 KiB │ - res/92.xml                                                 
           │   -1.5 KiB │           │   -4.6 KiB │ - res/pR.xml                                                 
           │   -1.3 KiB │           │   -3.8 KiB │ - res/EF.xml                                                 
           │   -1.2 KiB │           │   -3.9 KiB │ - res/2d.xml                                                 
           │   -1.2 KiB │           │   -1.2 KiB │ - META-INF/CERT.RSA                                          
           │   -1.1 KiB │           │   -2.2 KiB │ - res/y71.xml                                                
           │   -1.1 KiB │           │   -3.4 KiB │ - res/B4.xml                                                 
           │     -972 B │           │   -2.6 KiB │ - res/0k.xml                                                 
           │     -943 B │           │   -2.2 KiB │ - res/Hq.xml                                                 
           │     -916 B │           │   -2.8 KiB │ - res/wi.xml                                                 
           │     -840 B │           │   -2.6 KiB │ - res/G9.xml                                                 
           │     -785 B │           │   -1.6 KiB │ - res/0V.xml                                                 
           │     -782 B │           │   -1.7 KiB │ - res/dX.xml                                                 
           │     -781 B │           │   -1.5 KiB │ - res/84.xml                                                 
   1.1 KiB │     +722 B │   2.2 KiB │   +1.6 KiB │ ∆ res/y7.xml                                                 
           │     -719 B │           │   -1.5 KiB │ - res/FR.xml                                                 
           │     -678 B │           │   -1.5 KiB │ - res/fD1.xml                                                
     162 B │     -674 B │     120 B │   -1.7 KiB │ ∆ res/U0.xml                              
...✂
MANIFEST
@@ -11,3 +11,3 @@
   <uses-sdk
-      android:minSdkVersion="21"
+      android:minSdkVersion="24"
       android:targetSdkVersion="35"
@@ -64,3 +64,3 @@
       android:appComponentFactory="androidx.core.app.CoreComponentFactory"
-      android:extractNativeLibs="true"
+      android:extractNativeLibs="false"
       android:icon="@mipmap/ic_launcher"
DEX
STRINGS:

   old   │ new   │ diff               
  ───────┼───────┼────────────────────
   52011 │ 51786 │ -225 (+7045 -7270) 
  
  + IB
  + IIIZ
  + LJLZ
  + LZLLZLL
  + La1/j;
  + La1/k;
  + La1/l;
  + La1/m;
  + La1/n;
  + La1/o;
  + La1/p;
  + La1/q;
  + La1/r;
  + La1/s;
  + La2/a0;
  + La2/a1;
  + La2/a;
  + La2/b0;
  + La2/b1;
  + La2/b;
  + La2/c0;
  + La2/c1;
  + La2/c;
  + La2/d0;
  + La2/d1;
  + La2/d;
  + La2/e0;
  + La2/e1;
  + La2/e;
  + La2/f0;
  + La2/f1;
  + La2/f;
  + La2/g0;
  + La2/g1;
  + La2/g;
  + La2/h0;
  + La2/h1;
  + La2/h;
  + La2/i0;
  + La2/i1;
  + La2/i;
  + La2/j0;
  + La2/j;
  + La2/k0;
  + La2/k;
  + La2/l0;
  + La2/l;
  + La2/m0;
  + La2/m;
  + La2/n0;
  + La2/n;
  + La2/o0;
  + La2/o;
  + La2/p0;
  + La2/p;
  + La2/q0;
  + La2/q;
  + La2/r0;
  + La2/r;
  + La2/s0;
  + La2/s;
  + La2/t0;
  + La2/t;
  + La2/u0;
  + La2/u;
  + La2/v0;
  + La2/v;
  + La2/w0;
  + La2/w;
  + La2/x0;
  + La2/x;
  + La2/y0;
  + La2/y;
  + La2/z0;
  + La2/z;
  + La5/b;
  + La5/c;
  + La5/d;
  + La5/e;
  + La5/f;
  + La5/g;
  + La5/h;
  + La5/i;
  + La7/d;
  + La8/d;
  + La8/e;
  + La8/f;
  + La8/g;
  + La8/h;
  + La8/i;
  + La8/j;
  + La8/k;
  + La8/l;
  + La8/m;
  + La9/e;
  + La9/f;
  + La9/g;
  + Lab/k;
  + Lab/l;
  + Lab/m;
  + Lab/n;
  + Lab/o;
  + Lab/p;
  + Lab/q;
  + Lab/r;
  + Lab/s;
  + Lab/t;
  + Lab/u;
  + Lad/a0;
  + Lad/a1;
  + Lad/a2;
  + Lad/a3;
  + Lad/b0;
  + Lad/b1;
  + Lad/b2;
  + Lad/b3;
  + Lad/c0;
  + Lad/c1;
  + Lad/c2;
  + Lad/c3;
  + Lad/d0;
  + Lad/d1;
  + Lad/d2;
  + Lad/d3;
  + Lad/e0;
  + Lad/e1;
  + Lad/e2;
  + Lad/e3;
  + Lad/f0;
  + Lad/f1;
  + Lad/f2;
  + Lad/f3;
  + Lad/g0;
  + Lad/g1;
  + Lad/g2;
  + Lad/g3;
  + Lad/h0;
  + Lad/h1;
  + Lad/h2;
  + Lad/h3;
  + Lad/i0;
  + Lad/i1;
  + Lad/i2;
  + Lad/i3;
  + Lad/j0;
  + Lad/j1;
  + Lad/j2;
  + Lad/j3;
  + Lad/k0;
  + Lad/k1;
  + Lad/k2;
  + Lad/k3;
  + Lad/l0;
  + Lad/l1;
  + Lad/l2;
  + Lad/l3;
  + Lad/m0;
  + Lad/m1;
  + Lad/m2;
  + Lad/m3;
  + Lad/n0;
  + Lad/n1;
  + Lad/n2;
  + Lad/n3;
  + Lad/o0;
  + Lad/o1;
  + Lad/o2;
  + Lad/p0;
  + Lad/p1;
  + Lad/p2;
  + Lad/p;
  + Lad/q0;
  + Lad/q1;
  + Lad/q2;
  + Lad/q;
  + Lad/r0;
  + Lad/r1;
  + Lad/r2;
  + Lad/r;
  + Lad/s0;
  + Lad/s1;
  + Lad/s2;
  + Lad/s;
  + Lad/t0;
  + Lad/t1;
  + Lad/t2;
  + Lad/t;
  + Lad/u0;
  + Lad/u1;
  + Lad/u2;
  + Lad/u;
  + Lad/v0;
  + Lad/v1;
  + Lad/v2;
  + Lad/v;
  + Lad/w0;
  + Lad/w1;
  + Lad/w2;
  + Lad/w;
  + Lad/x0;
  + Lad/x1;
  + Lad/x2;
  + Lad/x;
  + Lad/y0;
  + Lad/y1;
  + Lad/y2;
  + Lad/y;
  + Lad/z0;
  + Lad/z1;
  + Lad/z2;
  + Lad/z;
  + Lah/e;
  + Lal/a0;
  + Lal/b0;
  + Lal/b;
  + Lal/c0;
  + Lal/c;
  + Lal/d0;
  + Lal/d;
  + Lal/e0;
  + Lal/e;
  + Lal/f;
  + Lal/g;
  + Lal/h;
  + Lal/i;
  + Lal/j;
  + Lal/k;
  + Lal/l;
  + Lal/m;
  + Lal/n;
  + Lal/o;
  + Lal/p;
  + Lal/q;
  + Lal/r;
  + Lal/s;
  + Lal/t;
  + Lal/u;
  + Lal/v;
  + Lal/w;
  + Lal/x;
  + Lal/y;
  + Lal/z;
  + Lan/b;
  + Lan/c;
  + Lan/d;
  + Landroid/graphics/drawable/DrawableWrapper;
  + Landroidx/lifecycle/a1_a;
  + Landroidx/lifecycle/t1;
  + Lb0/a0;
  + Lb0/a1;
  + Lb0/a2;
  + Lb0/b0;
  + Lb0/b1;
  + Lb0/b2;
  + Lb0/c0;
  + Lb0/c1;
  + Lb0/c2;
  + Lb0/d0;
  + Lb0/d1;
  + Lb0/d2;
  + Lb0/e0;
  + Lb0/e1;
  + Lb0/e2;
  + Lb0/f0;
  + Lb0/f1;
  + Lb0/f2;
  + Lb0/g0;
  + Lb0/g1;
  + Lb0/g2;
  + Lb0/h0;
  + Lb0/h1;
  + Lb0/h2;
  + Lb0/i0;
  + Lb0/i1;
  + Lb0/i2;
  + Lb0/j0;
  + Lb0/j1;
  + Lb0/j2;
  + Lb0/k0;
  + Lb0/k1;
  + Lb0/k2;
  + Lb0/l0;
  + Lb0/l1;
  + Lb0/l2;
  + Lb0/m0;
  + Lb0/m1;
  + Lb0/m2;
  + Lb0/n0;
  + Lb0/n1;
  + Lb0/n2;
  + Lb0/o0;
  + Lb0/o1;
  + Lb0/o2;
  + Lb0/p0;
  + Lb0/p1;
  + Lb0/p2;
  + Lb0/q0;
  + Lb0/q1;
  + Lb0/q2;
  + Lb0/q;
  + Lb0/r0;
  + Lb0/r1;
  + Lb0/r;
  + Lb0/s0;
  + Lb0/s1;
  + Lb0/s;
  + Lb0/t0;
  + Lb0/t1;
  + Lb0/t;
  + Lb0/u0;
  + Lb0/u1;
  + Lb0/u;
  + Lb0/v0;
  + Lb0/v1;
  + Lb0/v;
  + Lb0/w0;
  + Lb0/w1;
  + Lb0/w;
  + Lb0/x0;
  + Lb0/x1;
  + Lb0/x;
  + Lb0/y0;
  + Lb0/y1;
  + Lb0/y;
  + Lb0/z0;
  + Lb0/z1;
  + Lb0/z;
  + Lb1/a0;
  + Lb1/b0;
  + Lb1/c0;
  + Lb1/d0;
  + Lb1/e0;
  + Lb1/f0;
  + Lb1/g0;
  + Lb1/h0;
  + Lb1/i0;
  + Lb1/j0;
  + Lb1/q;
  + Lb1/r;
  + Lb1/s;
  + Lb1/t;
  + Lb1/u;
  + Lb1/v;
  + Lb1/w;
  + Lb1/x;
  + Lb1/y;
  + Lb1/z;
  + Lb3/b;
  + Lb3/c;
  + Lb3/d;
  + Lb3/e;
  + Lb3/f;
  + Lb3/g;
  + Lb3/h;
  + Lb3/i;
  + Lb3/j;
  + Lb3/k;
  + Lb3/l;
  + Lb3/m;
  + Lb3/n;
  + Lb3/o;
  + Lb3/p;
  + Lb3/q;
  + Lb3/r;
  + Lb3/s;
  + Lb6/b;
  + Lb6/c;
  + Lba/a0;
  + Lba/a1;
  + Lba/b0;
  + Lba/b1;
  + Lba/
...✂
ARSC
CONFIGS:

   old │ new │ diff       
  ─────┼─────┼────────────
   325 │ 317 │ -8 (+0 -8) 
  - color-v23
  - drawable-anydpi-v24
  - drawable-v23
  - layout-land-v22
  - layout-v22
  - style-v22
  - style-v23
  - style-v24
  

ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   6939 │ 6937 │ -2 (+0 -2) 
  - bool/abc_config_actionMenuItemAllCaps
  - drawable/abc_ic_menu_overflow_material

@emerge-tools
Copy link

emerge-tools bot commented Dec 4, 2025

3 builds decreased size

Name Version Download Change Install Change Approval
Stripe Identity Example
com.stripe.android.identity.example.theme1
22.3.0-theme1 (20) 4.2 MB ⬇️ 45.8 kB (-1.08%) 9.7 MB ⬇️ 133.6 kB (-1.36%) N/A
Financial Connections Example
com.stripe.android.financialconnections.example
22.3.0 (220300) 4.5 MB ⬇️ 65.3 kB (-1.43%) 10.0 MB ⬇️ 169.9 kB (-1.67%) N/A
PaymentSheet Example
com.stripe.android.paymentsheet.example
22.3.0 (11) 6.3 MB ⬇️ 111.9 kB (-1.74%) 14.7 MB ⬇️ 303.3 kB (-2.02%) N/A

Stripe Identity Example 22.3.0-theme1 (20)
com.stripe.android.identity.example.theme1

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 133.6 kB (-1.36%)
Total download size change: ⬇️ 45.8 kB (-1.08%)

Largest size changes

Item Install Size Change Download Size Change
androidx.camera.core.impl.utils.MainThreadAsyncHandler ⬆️ 40.1 kB ⬆️ 19.4 kB
🗑 androidx.compose.material.ButtonKt ⬇️ -38.1 kB ⬇️ -18.3 kB
🗑 kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt ⬇️ -36.0 kB ⬇️ -17.3 kB
🗑 androidx.compose.material.CheckboxDefaults ⬇️ -34.6 kB ⬇️ -16.7 kB
_COROUTINE._BOUNDARY ⬇️ -34.3 kB ⬇️ -16.5 kB
View Treemap

Image of diff

Financial Connections Example 22.3.0 (220300)
com.stripe.android.financialconnections.example

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 169.9 kB (-1.67%)
Total download size change: ⬇️ 65.3 kB (-1.43%)

Largest size changes

Item Install Size Change Download Size Change
🗑 com.stripe.android.link.ui.LinkSpinnerKt ⬇️ -83.6 kB ⬇️ -39.3 kB
📝 androidx.compose.material.SnackbarHostKt ⬆️ 76.8 kB ⬆️ 36.1 kB
🗑 com.stripe.android.link.ui.LinkContentKt ⬇️ -62.7 kB ⬇️ -29.4 kB
🗑 com.stripe.android.link.ui.SecondaryButtonKt ⬇️ -59.7 kB ⬇️ -28.0 kB
📝 androidx.compose.material.CheckboxDefaults ⬆️ 58.9 kB ⬆️ 27.7 kB
View Treemap

Image of diff

PaymentSheet Example 22.3.0 (11)
com.stripe.android.paymentsheet.example

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 303.3 kB (-2.02%)
Total download size change: ⬇️ 111.9 kB (-1.74%)

Largest size changes

Item Install Size Change Download Size Change
📝 com.stripe.android.paymentsheet.verticalmode.VerticalModeFormUIKt ⬆️ 64.2 kB ⬆️ 28.7 kB
🗑 com.stripe.android.model.parsers.PaymentMethodJsonParser$CardJson... ⬇️ -62.6 kB ⬇️ -28.0 kB
🗑 com.stripe.android.model.parsers.PaymentIntentJsonParser$Shipping... ⬇️ -58.6 kB ⬇️ -26.2 kB
📝 io.sentry.util.SampleRateUtils ⬆️ 58.1 kB ⬆️ 25.6 kB
🗑 io.sentry.android.replay.viewhierarchy.ComposeViewHierarchyNode ⬇️ -58.0 kB ⬇️ -25.4 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

@samer-stripe samer-stripe force-pushed the samer/upgrade-min-sdk-version branch from 7808bcc to ae17d21 Compare December 4, 2025 02:17
)

assertThat(client).isInstanceOf<UnsupportedPlacesClientProxy>()
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not needed since minimum is API 24 (Android N)

@samer-stripe
Copy link
Collaborator Author

Decent size reduction as well!

@samer-stripe samer-stripe force-pushed the samer/upgrade-min-sdk-version branch from ae17d21 to 118db15 Compare December 4, 2025 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants