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

Error: Attempt to invoke virtual method on a null object reference #553

Open
simon-abbott opened this issue Jun 27, 2022 · 16 comments
Open

Comments

@simon-abbott
Copy link

I'm on RN 0.67.4 and I'm trying to update from v8.0.0 to v8.1.0. iOS is working perfectly, but when I try to launch in Android I get the error Attempt to invoke virtual method 'boolean com.facebook.react.uimanager.FabricViewStateManager.hasStateWrapper()' on a null object reference.

@dsf3449
Copy link

dsf3449 commented Jun 28, 2022

I'm experiencing the same issue also on RN 0.67.4.

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.facebook.react.uimanager.FabricViewStateManager.hasStateWrapper()' on a null object reference
    at com.facebook.react.views.textinput.ReactEditText.updateCachedSpannable(ReactEditText.java:981)
    at com.facebook.react.views.textinput.ReactEditText.access$300(ReactEditText.java:75)
    at com.facebook.react.views.textinput.ReactEditText$TextWatcherDelegator.onTextChanged(ReactEditText.java:1092)
    at android.widget.TextView.sendOnTextChanged(TextView.java:10862)
    at android.widget.TextView.setText(TextView.java:6460)
    at android.widget.TextView.setText(TextView.java:6278)
    at android.widget.EditText.setText(EditText.java:121)
    at android.widget.TextView.setText(TextView.java:6230)
    at android.widget.TextView.setEditableFactory(TextView.java:6187)
    at androidx.emoji2.viewsintegration.EmojiEditTextHelper$HelperInternal19.<init>(EmojiEditTextHelper.java:268)
    at androidx.emoji2.viewsintegration.EmojiEditTextHelper.<init>(EmojiEditTextHelper.java:109)
    at androidx.appcompat.widget.AppCompatEmojiEditTextHelper.<init>(AppCompatEmojiEditTextHelper.java:52)
    at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:110)
    at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:91)
    at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:87)
    at com.facebook.react.views.textinput.ReactEditText.<init>(ReactEditText.java:126)
    at com.facebook.react.views.textinput.ReactTextInputManager.createViewInstance(ReactTextInputManager.java:180)
    at com.facebook.react.views.textinput.ReactTextInputManager.createViewInstance(ReactTextInputManager.java:81)
    at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139)
    at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:76)
    at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:281)
    at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:194)
    at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:1110)
    at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1081)
    at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
    at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
    at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1035)
    at android.view.Choreographer.doCallbacks(Choreographer.java:845)
    at android.view.Choreographer.doFrame(Choreographer.java:775)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7902)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:933)

@stetbern
Copy link

Same issue here, seems like it has been fixed in RN: facebook/react-native#33910

@jotahws
Copy link

jotahws commented Sep 9, 2022

Any news on that matter?

@stetbern
Copy link

An update to RN 0.68.3 & Gradle 7 solved that issue for me

@faboyds
Copy link

faboyds commented Sep 21, 2022

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

@hamdikahloun
Copy link

@faboyds Thanks

@appicsol
Copy link

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

Worked for me as well. Thanks a-lot.

@nilawildaalaluf
Copy link

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

why change this version? how about if I have implementation 'com.android.support:appcompat-v7:28.0.0', can I change it ?

@cap1-0
Copy link

cap1-0 commented Sep 21, 2023

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

thanks working as expected

@HemaVSL
Copy link

HemaVSL commented Sep 28, 2023

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

Thanks its working

@MarcosJBM
Copy link

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

Worked for me, thanks a lot!

"react-native": "0.66.4",
"react-native-keychain": "^8.1.2"

@vrsaket
Copy link

vrsaket commented May 2, 2024

Adding this to app/build.gradle worked for me:

dependencies {
...
implementation ("androidx.appcompat:appcompat:1.3.1") {
version {
strictly '1.3.1'
}
}
...
}

@sangpham9877
Copy link

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

worked for me, thanks bro

@noname0486
Copy link

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

why change this version? how about if I have implementation 'com.android.support:appcompat-v7:28.0.0', can I change it ?

I'm using another version of appcompat too, but change to 1.3.1 like above solved my problem

@cchhim
Copy link

cchhim commented Aug 30, 2024

An update to RN 0.68.3 & Gradle 7 solved that issue for me

it works for me too :)

@fahadcb
Copy link

fahadcb commented Oct 31, 2024

Adding this to app/build.gradle worked for me:

dependencies {
    ...
    implementation ("androidx.appcompat:appcompat:1.3.1") {
        version {
            strictly '1.3.1'
        }
    }
    ...
}

Work for me

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