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

Getting error : java.lang.NullPointerException #88

Open
Boubaker93 opened this issue Jan 3, 2020 · 5 comments
Open

Getting error : java.lang.NullPointerException #88

Boubaker93 opened this issue Jan 3, 2020 · 5 comments
Assignees

Comments

@Boubaker93
Copy link

Hello,
In my last version of my app i upgraded react-native-app-tour from version 0.0.19 to version 1.0.2
and i started getting this error in my deployed version java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources$Theme android.content.Context.getTheme().

Here is the a full stacktrace of the error :

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources$Theme android.content.Context.getTheme()' on a null object reference
       at android.app.AlertDialog.resolveDialogTheme(AlertDialog.java:227)
       at android.app.AlertDialog$Builder.<init>(AlertDialog.java:461)
       at ui.apptour.RNAppTourModule.ShowSequence(RNAppTourModule.java:70)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:808)
       at android.os.Handler.dispatchMessage(Handler.java:101)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
       at android.os.Looper.loop(Looper.java:166)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
       at java.lang.Thread.run(Thread.java:784) 

Here is an exemple how i'm using the lib in my code :

<TouchableOpacity
         disabled
         key='example'
         ref={ref => {
             if (!ref) return
             const props = tutorialProps. example
             if (addAppTourTarget) {
                 addAppTourTarget(AppTourView.for(ref, { ...props }))
             }
         }}>
         <MyComponent />
</TouchableOpacity>

Then in my app.js i use this once my appTourTargets have the length i want it :

    if (appTourTargets.length === length) {
        const appTourSequence = new AppTourSequence()
        appTourTargets.forEach(appTourTarget => {
            appTourSequence.add(appTourTarget)
        })
        AppTour.ShowSequence(appTourSequence)
    }

I'm using using react-native: 0.61.5

Thanks for your help

@prscX
Copy link
Owner

prscX commented Jan 4, 2020

Thanks @Boubaker93 for raising the issue.

Considering you are using latest RN, could you try it with latest version of the library 1.*

Let me know incase it does not work.

Thanks
</ Pranav >

@prscX prscX self-assigned this Jan 4, 2020
@Eesssn
Copy link

Eesssn commented Jan 5, 2020

same issue.
i use RN 0.61.5
and app-tour version 1.0.2
but got same error

@Boubaker93 i have a solution (but not good solution, just for running away from this issue :) ) run this command
" gradlew assembleRelease -x lintVitalRelease "
it works.
this library should debug.
thank @prscX

@Boubaker93
Copy link
Author

Yes me too i'm getting this error in version 1.0.2.

@Eesssn will try that out but as you said the best solution :D

thx for that @Eesssn

@SaidDos
Copy link

SaidDos commented Nov 25, 2020

same crash here i'm using react-native-app-tour version 1.0.4

@gr0x0
Copy link

gr0x0 commented Mar 26, 2023

Hello. This issue is still happening. Any updates?

My specs:
RN 0.67.5
app-tour version 1.0.5

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

No branches or pull requests

5 participants