Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text inputs generate stack traces #3000

Open
CT-PDept opened this issue Jan 10, 2024 · 3 comments
Open

Text inputs generate stack traces #3000

CT-PDept opened this issue Jan 10, 2024 · 3 comments
Labels

Comments

@CT-PDept
Copy link

Problem Description

Users are unable to click into a text input. Hooking the app up to Android Studio to check the logs I have observed several stack traces related to text input fields.

java.lang.NullPointerException: Attempt to invoke virtual method 'int com.adobe.air.AndroidStageTextAsync.getMaxChars()' on a null object reference
at com.adobe.air.AndroidStageText.getMaxChars(AndroidStageText.java:403)
at com.adobe.air.customHandler.callTimeoutFunction(Native Method)
at com.adobe.air.customHandler.handleMessage(customHandler.java:34)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.adobe.air.AndroidStageTextAsync.getRestrict()' on a null object reference
at com.adobe.air.AndroidStageText.getRestrict(AndroidStageText.java:376)
at com.adobe.air.customHandler.callTimeoutFunction(Native Method)
at com.adobe.air.customHandler.handleMessage(customHandler.java:34)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.Bitmap com.adobe.air.AndroidStageTextAsync.captureSnapshot(int, int)' on a null object reference
at com.adobe.air.AndroidStageText.captureSnapshot(AndroidStageText.java:571)
at com.adobe.air.customHandler.callTimeoutFunction(Native Method)
at com.adobe.air.customHandler.handleMessage(customHandler.java:34)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

  • Which AIR SDK did you use?
    50.2.3
    50.2.4

  • Describe the affected environment:

I assume all Android. I have tried and successfully replicated on:

Android
Physical:
Galaxy S9 Android 10
Galaxy S10+ Android 12

Emulator:
Pixel XL Android 13

  • Can you reproduce it yourself, or did you get reports from other users? If so, how many users are affected (percentage)?
    I can reproduce it myself. The problem was found by our QA and is not in customer's hands yet

Steps to Reproduce

Open the app from scratch.

If you go straight to the page and straight to the input it works as expected.
Once you click on another page and return, or if you went to some other pages first, stack traces are logged to Logcat when you enter the page and you are unable to click into the input field.

Give us a minimal example:

<s:TextInput id="searchBar" width="100%" height="100%" styleName="searchInput" change="searchBar_changeHandler(event)" prompt="{IconText.search}"/>

There appear to be several other issues logged relating to Null Pointer exceptions, but none with the exact functions I am seeing in the logs.

@CT-PDept CT-PDept added the Bug label Jan 10, 2024
@ajwfrost
Copy link
Collaborator

Just to confirm that this is what I think it is ... are you able to confirm if you have the runtimeInBackgroundThread setting in your application descriptor XML file, set to true? And these errors would presumably go away if this was set to false?

We've added some protection already for some functions but maybe not all, I'll review these to ensure we're not getting caught out (the issue happens due to the async nature of these calls now, because we are running AIR in a background thread but a lot of these UI updates have to then be in the main thread, and there's not sufficient coordination or thread-safety between these)

thanks

@CT-PDept
Copy link
Author

We did not have runtimeInBackgroundThread explicitly set. Trying both false and true does not change the functionality we are seeing.

@ajwfrost
Copy link
Collaborator

Okay thanks -> belatedly investigating and finding that the changes we made in also to support the asynchronous runtime on Android, also means it's impossible to take a StageText element off the stage and then add it back later on. The same root cause as this -> we lose a reference to the underlying 'AndroidStageText' class when it's removed from the stage...

Will get this into our next release!

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants