Individual crashes received on Samsung devices only with Lollipop versions 5.0 and 5.1

Over the past 2 months, we began to get malfunctions on our developer console only for some Samsung devices.

Here is the failure trace

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'samsung/ha3gjv/ha3g:5.0/LRX21V/N9000QXXUEBOG3:user/release-keys' Revision: '11' ABI: 'arm' pid: 10422, tid: 10478, name: AsyncTask #2 >>> com.sample.app <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c r0 131413a0 r1 131413a0 r2 b1687070 r3 00262827 r4 00000349 r5 131413a0 r6 00000000 r7 00000002 r8 131412c0 r9 af071800 sl 87783218 fp 13141360 ip 000031d0 sp 9530e8c0 lr 7446c91f pc a0a83596 cpsr 000f0030 backtrace: #00 pc 001bc596 /data/dalvik-cache/arm/ data@app @ com.sample.app-2@base.apk @classes.dex #01 pc 0008091d /system/framework/arm/boot.oat 

And here is a list of devices where failures to date were received -

 Galaxy S6 (zeroflte) Galaxy S6 Edge+ (zenltevzw) Galaxy A5(2016) (a5xelte) Galaxy S5 Neo (s5neolte) Galaxy S6 Edge (zerolte) Galaxy S6 (zerofltetmo) Galaxy Note3 (ha3g) Galaxy J7 (j7elte) Galaxy Note4 (trelte) Galaxy S5 (k3g) Galaxy Alpha (slte) 

Any ideas on why this is happening?

Here is build.gradle

 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.0" defaultConfig { applicationId "com.test" minSdkVersion 14 targetSdkVersion 22 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile files('libs/okhttp-2.4.0.jar') compile files('libs/okhttp-urlconnection-2.4.0.jar') compile files('libs/okio-1.4.0.jar') compile files('libs/mediaplayersdk.jar') compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.google.android.gms:play-services-ads:8.4.0' compile 'com.android.support:appcompat-v7:23.1.0' } 
+7
android samsung-mobile android-5.0-lollipop native crash
source share
2 answers

According to Android root failure starting with /system/framework/arm/boot.oat , this error occurs on some Samsung devices when apk zipaligned uses Zopfli.

According to your build.gradle you are using buildToolsVersion "23.0.0" , so I would say that your apk is zipaligned using Zopfli and this is the source of the problem you are discovering (Zopfli was added in version 21.0.0 ).

Please note that when you create apk using Build -> Generate Signed APK , your apk will loop automatically. From the documentation :

zipalign is an archive alignment tool that provides important optimization for Android applications (.apk)

To solve this problem, you can avoid automatically adding zipalign to zipAlignEnabled false in the release section of your build.gradle :

 release { //... zipAlignEnabled false } 

Then you need to generate apk again (you can verify that your apk is not zipaligned running zipalign -c -v 4 yourapk.apk . It will output Verification FAILED ) and then manually zipalign apk using zipalign commands , avoiding the -z option.

 zipalign -f -v 4 yourapk.apk yourzipalignedapk.apk 

Another option is to change buildToolsVersion to, for example, 20.0.0 (the zipalign tool in this version of doen't includes Zopfli), but this is not recommended (From the documentation ):

You should always update the Build Tools component by downloading the latest version using the Android SDK Manager. By default, the Android SDK uses the latest downloaded version of Build Tools. If your projects depend on older versions of Build Tools, the SDK Manager allows you to download and maintain separate versions of tools for use with these projects.

+4
source share

I found the right solution here . Using

  -keep class !android.support.v7.internal.view.menu.**,android.support.v7.** {*;} 

instead

  -keep class android.support.v7.** {*;} 
0
source share

All Articles