SMS send block causing NullPointerException

346 views
Skip to first unread message

Henrik "The Developer" Lindqvist

unread,
Dec 29, 2016, 5:01:47 PM12/29/16
to automa...@googlegroups.com
On some devices the SMS send block will fail with the following error:
java.lang.NullPointerExeption: Attempt to read from field 'java.lang.String android.content.pm.PackageInfo.packageName' on a null object reference

This is Android or manufacturer ROM bug. It seems to be cause by the app "thread" (ActivityThread) not being properly initialized, cause yet unknown.
The only workaround, for now, is to use the MMS send block instead.

Conclusion of testing so far:
  • It doesn't seem to be caused by sending from a background (non-main) thread.
  • It doesn't seem to be caused by the SEND_SMS permission being in the separate add-on app.
  • Multiple user profiles (device users) running Automate on the same device.
  • The use of sharedUserId, i.e. sharing a single uid (app user space) for multiple apps, as Automate does to facilitate the permissions add-ons.
  • The use of a separate process for background work, as Automate does to reduce memory usage.
  • Binder caller uid/pid "leakage".

Reportedly affected devices:

  • Android 5.1 on a Meizu M2 with Flyme OS 4.5.3.2C
  • Doogee X5 with stock ROM v18 and several custom ROMs
  • P8000 phone on Android 6 (working on Android 5.1)
  • Philips Xenium v377
  • Android 6.0 on Lenovo A7000
  • acer/T03_emea_gen1/acer_t03:5.1

Please post your device manufacturer/model, Android version and custom ROM name, if used.


Alpha version 1.6.0a1 include a new workaround, please test:
https://play.google.com/apps/testing/com.llamalab.automate

A workaround has been found! Enable the SMS send workaround option if settings.
com.llamalab.smsbug.bg1.apk
com.llamalab.smsbug.su1.apk

Henrik "The Developer" Lindqvist

unread,
Jan 2, 2017, 8:19:26 PM1/2/17
to Automate
New test app created!
Please run the attached debug app to help me test if the use of a background process is the cause of the issue.
com.llamalab.smsbug.bg1.apk

schurli...@gmail.com

unread,
Jan 2, 2017, 9:10:52 PM1/2/17
to Automate
Hi Henrik,

just tested your app and I tried sending myself and my girlfriend the test sms and both WORKED.

Congratulations, do you need any info, logs?
I am the Meizu guy ;-)

Message has been deleted

giovann...@gmail.com

unread,
Jan 3, 2017, 2:05:02 AM1/3/17
to Automate
This app on Xiaomi Mi5, works fine!

brai...@gmail.com

unread,
Jan 3, 2017, 2:24:54 AM1/3/17
to Automate
On Tuesday, January 3, 2017 at 3:19:26 AM UTC+2, Henrik "The Developer" Lindqvist wrote:
New test app created!
Please run the attached debug app to help me test if the use of a background process is the cause of the issue.

It worked! "SMS send without issue"!

Device: Lenovo A7000-a
Android version: 6.0
Build number: A7000-a_S228_160621_ROW

It seems that you found a workaround to the bug, so we hope to get soon a new "Automate" version!
And again, congratulations for your fine application.

Constantin Teodorescu


Henrik "The Developer" Lindqvist

unread,
Jan 3, 2017, 2:41:28 PM1/3/17
to Automate
Thanks for testing, and reporting back.
Sadly, a successfully sent SMS is not was i was hoping for since it means we still haven't found the cause.
I'll post another test app soon.

Henrik "The Developer" Lindqvist

unread,
Jan 3, 2017, 7:56:54 PM1/3/17
to Automate
New test app created!
Please run the attached debug app to help me test if the use of sharedUserId (including a background process) is the cause of the issue.
com.llamalab.smsbug.su1.apk

saffl...@gmail.com

unread,
Jan 3, 2017, 8:49:00 PM1/3/17
to Automate
Medion E5004 with Android 5.1

brai...@gmail.com

unread,
Jan 4, 2017, 3:50:44 AM1/4/17
to Automate
On Wednesday, January 4, 2017 at 2:56:54 AM UTC+2, Henrik "The Developer" Lindqvist wrote:
New test app created!
Please run the attached debug app to help me test if the use of sharedUserId (including a background process) is the cause of the issue.

This second new test app worked also for me: "SMS send without issue" , received it on another phone!

Same Device: Lenovo A7000-a
Android version: 6.0
Build number: A7000-a_S228_160621_ROW 

Teo

Henrik "The Developer" Lindqvist

unread,
Jan 4, 2017, 5:50:24 PM1/4/17
to Automate, brai...@gmail.com
Okay, i'll make some other changes.

otakim...@gmail.com

unread,
Jan 22, 2017, 11:40:26 PM1/22/17
to Automate
Am having the same problem, tried several messaging apps, always flow reports '1 SMS sent to...' but does not arrive. Tried the second smsbug test app and worked OK, SMS received OK on destination phone!

Device: Lenovo A3600-d
Android version: 4.4.2
Build number: A3600-d_S161_141210_CU_verter.org 

On Friday, December 30, 2016 at 11:01:47 AM UTC+13, Henrik "The Developer" Lindqvist wrote:
On some devices the SMS send block will fail with the following error:
java.lang.NullPointerExeption: Attempt to read from field 'java.lang.String android.content.pm.PackageInfo.packageName' on a null object reference

This is Android or manufacturer ROM bug. It seems to be cause by the app "thread" (ActivityThread) not being properly initialized, cause yet unknown.
The only workaround, for now, is to use the MMS send block instead.


An initial round of testing has been done, conclusion so far:

  • It doesn't seem to be caused by sending from a background (non-main) thread.
  • It doesn't seem to be caused by the SEND_SMS permission being in the separate add-on app.


Possible causes still to be tested, see attached APKs below:

Henrik "The Developer" Lindqvist

unread,
Jan 24, 2017, 7:14:25 PM1/24/17
to automa...@googlegroups.com
Trying a new workaround in Alpha 1.6.0a1:
https://plus.google.com/u/0/b/110165001747691845730/110165001747691845730/posts/ZgetBzG9Kdt

Please let me know if it works, or as most likely, it doesn't.

saffl...@gmail.com

unread,
Jan 26, 2017, 8:05:15 PM1/26/17
to Automate
404 error on that link

saffl...@gmail.com

unread,
Jan 26, 2017, 8:06:54 PM1/26/17
to Automate
Forgive the stupid question, how do i manually install test apps? - I thought the only way was via google play lol.

Henrik "The Developer" Lindqvist

unread,
Jan 26, 2017, 8:20:18 PM1/26/17
to Automate, saffl...@gmail.com
Odd, link work find for me. Yes Alpha/Beta version are distributed by the Google Play Store but you'll have to opt-in at:
https://play.google.com/apps/testing/com.llamalab.automate

google user

unread,
Jan 29, 2017, 9:28:49 PM1/29/17
to Automate, saffl...@gmail.com
you need to download the apk like any other file from a host, then open it from your file viewer.
Since it's an unknown, unvetted file, android will refuse it. You'll have to activate "install from unknown sources"
http://gs4.gadgethacks.com/forum/enable-unknown-sources-android-install-apps-outside-play-store-0150603/

Henrik "The Developer" Lindqvist

unread,
Jan 31, 2017, 9:47:43 PM1/31/17
to Automate
Anyone testing the workaround? Feedback please!

saffl...@gmail.com

unread,
Feb 1, 2017, 7:35:20 AM2/1/17
to Automate
Disappointingly that test app worked. I hoped it would fall so that you would have a better clue about what's going wrong.

saffl...@gmail.com

unread,
Feb 1, 2017, 7:39:47 AM2/1/17
to Automate
I did join the test group until I realised that the new version would replace my existing version so I had to leave again. Sorry about that. If you can make it possible to run both somehow then I will join again.

Henrik "The Developer" Lindqvist

unread,
Feb 1, 2017, 2:01:34 PM2/1/17
to Automate, saffl...@gmail.com
Which app did you test?

Please test the Alpha:
https://play.google.com/apps/testing/com.llamalab.automate

You can have either the Alpha or the public (1.5.1) version installed. 

Henrik "The Developer" Lindqvist

unread,
Feb 6, 2017, 6:53:27 PM2/6/17
to Automate
Due to the lack of feedback, i'm now forced to remove the experimental workaround implement in Alpha version 1.6.0a1 before public release.

jeremy.n...@gmail.com

unread,
Feb 8, 2017, 1:59:02 PM2/8/17
to Automate
Hi have the same issue on my WIKO LENNY 3 (Android 6.0).
Can you please notify me when the experimental workaround is available in the alpha version.
If you want I can try your test app ?
Thanks

Henrik "The Developer" Lindqvist

unread,
Feb 8, 2017, 2:26:36 PM2/8/17
to Automate, jeremy.n...@gmail.com
It's already available in the currently published Alpha version 1.6.0a1. Enable it in Automate settings.
Download at: https://play.google.com/apps/testing/com.llamalab.automate

jeremy.n...@gmail.com

unread,
Feb 8, 2017, 4:56:21 PM2/8/17
to Automate
I have a good news for you, the workaround is perfect !
Video : https://drive.google.com/file/d/0B59uGPL2RIChX3NIMTdwTGZ2OEk/view?usp=drivesdk

Henrik "The Developer" Lindqvist

unread,
Feb 8, 2017, 5:06:11 PM2/8/17
to Automate, jeremy.n...@gmail.com
THANK YOU!
Great, finally a working solution. So the use of separate processes is the culprit.

saffl...@gmail.com

unread,
Mar 22, 2017, 12:44:11 PM3/22/17
to Automate
Confirmed. Workaround in the options works for me too although it does perhaps need to be made clearer that this option is available.

prasada...@gmail.com

unread,
Aug 31, 2017, 9:15:39 AM8/31/17
to Automate
I too had the same issue in XIOMI Redmi Note 4(Android 6.0.1). So can you please post the workaround?


On Friday, December 30, 2016 at 3:31:47 AM UTC+5:30, Henrik "The Developer" Lindqvist wrote:
On some devices the SMS send block will fail with the following error:
java.lang.NullPointerExeption: Attempt to read from field 'java.lang.String android.content.pm.PackageInfo.packageName' on a null object reference

This is Android or manufacturer ROM bug. It seems to be cause by the app "thread" (ActivityThread) not being properly initialized, cause yet unknown.
The only workaround, for now, is to use the MMS send block instead.

Conclusion of testing so far:
    • It doesn't seem to be caused by sending from a background (non-main) thread.
    • It doesn't seem to be caused by the SEND_SMS permission being in the separate add-on app.
    • Multiple user profiles (device users) running Automate on the same device.
    • The use of sharedUserId, i.e. sharing a single uid (app user space) for multiple apps, as Automate does to facilitate the permissions add-ons.
    • The use of a separate process for background work, as Automate does to reduce memory usage.
    • Binder caller uid/pid "leakage".

    Reportedly affected devices:

    • Android 5.1 on a Meizu M2 with Flyme OS 4.5.3.2C
    • Doogee X5 with stock ROM v18 and several custom ROMs
    • P8000 phone on Android 6 (working on Android 5.1)
    • Philips Xenium v377
    • Android 6.0 on Lenovo A7000
    • acer/T03_emea_gen1/acer_t03:5.1

    Please post your device manufacturer/model, Android version and custom ROM name, if used.


    Alpha version 1.6.0a1 include a new workaround, please test:
    https://play.google.com/apps/testing/com.llamalab.automate

    A workaround has been found! Enable the SMS send workaround option if settings.

    Henrik "The Developer" Lindqvist

    unread,
    Aug 31, 2017, 2:54:51 PM8/31/17
    to Automate, prasada...@gmail.com
    As the doc say, enable the "SMS send workaround" option in Automate settings.

    aman.v...@gmail.com

    unread,
    Dec 19, 2018, 10:58:22 AM12/19/18
    to Automate

    SMS error redmi 5A.PNG

    Getting this error. As you can see the Device is Redmi 5A and the version is 7.1.2.
    What could be the reason of this error?
    The Permissions are given. I think this is internal and device dependent.
    Reply all
    Reply to author
    Forward
    0 new messages