BinaryEye icon indicating copy to clipboard operation
BinaryEye copied to clipboard

V1.27.0 crashes on launch

Open nhfo opened this issue 5 years ago • 29 comments

Device: OnePlus X Android version: 6.0.1 App version: 1.27.0 (f-droid build)

App crashes as soon as launched. UI is visible for split second. I managed to tap history icon and scan list came up and stayed there and functioned as expected.

Looking in logs i found this line which might be the root issue.

30315 30413 E RenderScript: Unable to open shared library (/data/user/0/de.markusfisch.android.binaryeye//lib/librs.rotator.so): dlopen failed: invalid ELF file "/data/app/de.markusfisch.android.binaryeye-2/lib/arm/librs.rotator.so" load segment[5]: p_offset (0x3000) + p_filesz (0x0) ( = 0x3000) past end of file (0x2550)

nhfo avatar May 12 '20 11:05 nhfo

Sorry for that 😞 Please update to 1.27.1 which should crash only the very first time and work after that. Odd, I know 🙈

The reason for this crash is that 1.27.0 doesn't call RenderScript.forceCompat() by default, as earlier versions have. The problem with calling RenderScript.forceCompat() is, that it disables the native processing most - but obviously not all - devices offer. Unfortunately, there's no way to know if RenderScript.forceCompat() is required or not 😬

Since I was getting reports about crashes from not calling RenderScript.forceCompat() from Lineage users only, I thought it'd be enough to call it just for Lineage. Obviously, it's not.

1.27.1 tries to fix the problem by calling RenderScript.forceCompat() after RenderScript has crashed. See details in this commit: https://github.com/markusfisch/BinaryEye/commit/307401087e9439087c58bdceb575811d314a512b

markusfisch avatar May 12 '20 13:05 markusfisch

Thanks for the explanation and a quick fix. I will wait for it to trickle into f-droid.

nhfo avatar May 12 '20 20:05 nhfo

Did 1.27.1 solve the problem?

If not, please try Version 1.28.0 either directly from GitHub: https://github.com/markusfisch/BinaryEye/releases/tag/1.28.0

Or by becoming a beta tester on Google Play (don't worry, you can go back to production at any time): https://play.google.com/apps/testing/de.markusfisch.android.binaryeye

Or until it's on FDroid 😉

markusfisch avatar May 15 '20 12:05 markusfisch

Finally got chance to try it on another phone which runs Android 7. 1.27.1 did not solve the problem. But 1.28.0 works fine. Thanks.

nhfo avatar May 16 '20 15:05 nhfo

Great 😄 Thanks for reporting 👍

markusfisch avatar May 17 '20 18:05 markusfisch

@markusfisch it still crashes on OnePlus x. App seems to restart three times then disappears without popping any crash notice. log.txt is attached.

nhfo avatar May 18 '20 11:05 nhfo

Sorry for the inconvenience 😞 That's strange. I was hoping the "invalid ELF file" error message was somehow related to RenderScript's compat mode. But that doesn't seem to be the case because it still claims that librs.rotator.so (which holds the custom RenderScript kernel to rotate the camera frame) doesn't fit the architecture:

E(30566:30663) Unable to open shared library (/data/user/0/de.markusfisch.android.binaryeye//lib/librs.rotator.so): dlopen failed: invalid ELF file "/data/app/de.markusfisch.android.binaryeye-2/lib/arm/librs.rotator.so" load segment[5]: p_offset (0x3000) + p_filesz (0x0) ( = 0x3000) past end of file (0x2550)

Did Binary Eye run before 1.27.0 on this device?

It seems to be a(nother) bug in Android's build tools 😞

markusfisch avatar May 18 '20 13:05 markusfisch

Yes up to 1.26.0, it used to run fine.

I uninstalled app keeping data and cache and installed version 1.26.0, it still runs fine.

nhfo avatar May 18 '20 13:05 nhfo

I've got a hunch 🤔 I just checked the corresponding APKs from GitHub here 1.26.0 and here 1.28.0 and all native binaries are exactly the same. I always upload these APKs to Google Play so there is no difference.

Then, I downloaded the APK from F-Droid and found that librs.rotator.so is slightly smaller there than in my builds! The rest of the libraries are the same size.

F-Droid's libraries don't match mine exactly what's probably only because of the compiler meta data that's included in an ELF file.

But I really can't explain the size difference yet. So, I would like to ask you to try 1.28.0 directly from GitHub if that's okay with you? https://github.com/markusfisch/BinaryEye/releases/tag/1.28.0

If this works, the reason would be in F-Droid's build setup somewhere.

markusfisch avatar May 18 '20 15:05 markusfisch

Unfortunately I have the same problem: github release 1.28.0 working fine, f-droid release 1.28.0 crashes

arnep-de avatar May 18 '20 16:05 arnep-de

@markusfisch your hunch is correct, it behaves as @arnep-de reported. Can you follow up with f-droid team?

nhfo avatar May 18 '20 19:05 nhfo

Thank you both for reporting that quickly 👍 So the F-Droid build seems to be broken somehow 🤔

I've re-opened #111 and described the problem in https://github.com/markusfisch/BinaryEye/issues/111#issuecomment-630695512

markusfisch avatar May 19 '20 09:05 markusfisch

Just to let you know Binary Eye 1.30.0 also crashes here on a Samsung Galaxy S5 Mini with Android 6.0.1.

billie80 avatar Jun 02 '20 19:06 billie80

@billie80 Did you get it from F-Droid or from Google Play?

And does it crash every time or just occasionally?

markusfisch avatar Jun 02 '20 19:06 markusfisch

I use the F-Droid build and it crashes every time. After the splash screen the camera comes up shortly for about three times and then the App closes.

billie80 avatar Jun 02 '20 20:06 billie80

@billie80 I'm sorry, that's just still the same problem 😞 The F-Droid build doesn't work for some devices because of a bug in the build tools (see above). Because F-Droid builds the APK itself, I can't change that directly, unfortunately 😬 I hope it will be fixed pretty soon, see #111

In the meantime you may install the APK directly from GitHub (if that's okay with you): https://github.com/markusfisch/BinaryEye/releases

markusfisch avatar Jun 03 '20 07:06 markusfisch

Already tried that and it works with the Github APK! Just want to let you know it also fails with my device. Will switch back to F-Droid once this is fixed!

billie80 avatar Jun 03 '20 07:06 billie80

Hi,

Using the fdroid version 1.30.1 with a One Plus phone here. I had the same crashes after updates. Once I reinstalled the app fully it worked again. Maybe some caches had to be cleared or something.

arturbosch avatar Jun 06 '20 07:06 arturbosch

@arturbosch Thanks for reporting 👍 The F-Droid build still doesn't work on all devices, unfortunately. Sorry for the inconvenience. I'm working on it.

markusfisch avatar Jun 06 '20 13:06 markusfisch

I think you experienced a different issue then. Here at least this approach did not work. I tried deleting all the Apps cache and data and even did a complete reinstall. Thinking about it. If the issue is a library compiled in a wrong way why should this work? You are just installing the same defunct library again! But you are right that sometimes deleting caches fixes crashes. App data too but you don't want to lose this if you can't back it up before.

billie80 avatar Jun 06 '20 13:06 billie80

I can confirm this crash with version 1.31.0 from F-Droid on older ASUS Zen Pad with Android 6. App opens, flashes three times, and is gone.

LeSpocky avatar Jun 14 '20 07:06 LeSpocky

I can also confirm this crash. Version 1.31.0 from F-Droid. Motorola Moto Z with LineageOS 16. Same behavior as described above.

q-pa avatar Jun 17 '20 19:06 q-pa

Just to let you know. I now have a new device running Android 10 where the problem is gone!

billie80 avatar Jul 25 '20 08:07 billie80

I have a similar problem with all versions of 1.34 on android 4.4 https://github.com/markusfisch/BinaryEye/issues/126#issuecomment-682186799

monolifed avatar Aug 27 '20 21:08 monolifed

Sorry for the inconvenience and sorry for the late answer. Unfortunately I can't reproduce this on my devices running Android 4.4 😬

Is this a custom ROM or stock Android? Do previous versions of the app work on your device?

markusfisch avatar Sep 05 '20 09:09 markusfisch

I was wrong, the device was using Android 4.1.2 Sorry for the inconvenience

monolifed avatar Sep 05 '20 11:09 monolifed

I have the exact same problem on my Nokia 4.2 running Android 10: The app flashes three times and then crashes. This happens with the F-Droid version, 1.34.0. On my wife's phone (Samsung Galaxy A3 running Android 8), the F-Droid version works. Interestingly, if I install 1.34.0 via Google Play, the app works on my Nokia. Same for the APK from here.

How can I help to track this down? I really would like to use the F-Droid version ;-)

l3u avatar Sep 22 '20 20:09 l3u

@l3u The reason the F-Droid version breaks on some devices is that F-Droid always builds with the NDK (and I haven't found a way to force it to not use the NDK yet).

Unfortunately, there's a bug in the build tools producing broken RenderScript libraries for some architectures when the NDK is available. When the build tools cannot find the NDK, the generated libraries work on all architectures.

So there are two problems causing the issue: the bug in the build tools and that we can't keep F-Droid from using an NDK 😬

Here are more details on the issue: https://github.com/markusfisch/BinaryEye/issues/111

Alternatively, you can also use the build from GitHub if you don't want to use Google Play: https://github.com/markusfisch/BinaryEye/releases

Although that is the exact same file I upload to Google Play 😉

markusfisch avatar Sep 25 '20 13:09 markusfisch

Yeah, that's what I did. I simply installed the github release. Well, apparently, I can't help here … maybe someone from F-Droid can give a hint?

Anyway, thanks for your work, Binary Eye is as of now the nicest barcode scanner I found ;-)

l3u avatar Sep 25 '20 15:09 l3u