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

RN - Android - Modal + Home Button Long Press = app crash #15440

Closed
GitHubTracey opened this issue Aug 9, 2017 · 3 comments
Closed

RN - Android - Modal + Home Button Long Press = app crash #15440

GitHubTracey opened this issue Aug 9, 2017 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@GitHubTracey
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v: 0.44.3
  2. node -v: v8.2.1
  3. npm -v: 5.3.0
  4. yarn --version<!-- (if you use Yarn) —>: n/a

Target Platform: [Android/iOS]
Development Operating System: macOS
Build tools: Android Studios/xCode

Steps to Reproduce

Open App on Android phone
Open Category (custom component)
Open Modal
Hold Home button (long press)
App Crashes…

Expected Behavior

Expect app to hide in background until user brings app back up again, and return to same screen.

Actual Behavior

App Crashes with error: “Unfortunately myApp has stopped [OK]”

Notes / Comments

  • does not happen for iOS
  • does not happen for any other component
  • for one of the modals, we use touchid to log the user in - if the user has a registered fingerprint, on a longpress, the user is signed in and the app does not crash.

Reproducible Demo

All modals are designed the same way. I have removed styling for clarity.

<Modal
    onRequestClose={()=> {
        props.waitingForResponse(false);
    }}
    visible={props.visible}>
    <View>
        <View>
            <View>
                <Image source={modalImageSrc} />
                <Text>
                    {props.showErrorMesage ? "Error" : props.title}
                </Text>
                <Text>{props.showErrorMesage ? "Item disabled" : props.text}</Text>
            </View>
            <View>
                <Button
                    onPress={()=> {
                        props.waitingForResponse(false);
                    }}
                    title="Cancel"
                />
            </View>
        </View>
    </View>
</Modal>
@christophermark
Copy link

I can reproduce as well on React Native 43.3

Android error:

                                                                        java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.dispatchProvideStructure(android.view.ViewStructure)' on a null object reference
                                                                            at android.view.ViewGroup.dispatchProvideStructure(ViewGroup.java:2961)
                                                                            at android.view.ViewGroup.dispatchProvideStructure(ViewGroup.java:2961)
                                                                            at android.view.ViewGroup.dispatchProvideStructure(ViewGroup.java:2961)
                                                                            at android.view.ViewGroup.dispatchProvideStructure(ViewGroup.java:2961)
                                                                            at android.view.ViewGroup.dispatchProvideStructure(ViewGroup.java:2961)
                                                                            at android.view.ViewGroup.dispatchProvideStructure(ViewGroup.java:2961)
                                                                            at android.view.ViewGroup.dispatchProvideStructure(ViewGroup.java:2961)
                                                                            at android.view.ViewGroup.dispatchProvideStructure(ViewGroup.java:2961)
                                                                            at android.app.assist.AssistStructure$WindowNode.<init>(AssistStructure.java:422)
                                                                            at android.app.assist.AssistStructure.<init>(AssistStructure.java:1335)
                                                                            at android.app.ActivityThread.handleRequestAssistContextExtras(ActivityThread.java:2586)
                                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1539)
                                                                            at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                            at android.os.Looper.loop(Looper.java:148)
                                                                            at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                            at java.lang.reflect.Method.invoke(Native Method)
                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

@christophermark
Copy link

Dupe of #13201

@GitHubTracey
Copy link
Author

closing in favour of #13201

@facebook facebook locked as resolved and limited conversation to collaborators Aug 23, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants