# java.lang.NullPointerException: Attempt to invoke virtual method

**URL:** <https://devforum.zoom.us/t/java-lang-nullpointerexception-attempt-to-invoke-virtual-method/103870>\
**Category:** Android\
**Created:** [February 15, 2024, 2:13am UTC](https://devforum.zoom.us/t/java-lang-nullpointerexception-attempt-to-invoke-virtual-method/103870 "2024-02-15T02:13:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![margaterjay](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/margaterjay/32/56604_2.png) [@margaterjay](https://devforum.zoom.us/u/margaterjay)\
**Post date:** [February 15, 2024, 2:13am UTC](https://devforum.zoom.us/t/java-lang-nullpointerexception-attempt-to-invoke-virtual-method/103870/1 "2024-02-15T02:13:43Z")

</div>

I am encountering a null object reference issue in my custom view. Unfortunately, I cannot reproduce the crashes even with the release APK. Some users are experiencing null object reference errors in the production environment

“setTextSize(int, float)’ on a null object reference”

Code:  
sampleTextView = findViewById(R.id.sampleTextView);  
sampleTextView.setTextSize(12.0f);

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [March 16, 2024, 12:14pm UTC](https://devforum.zoom.us/t/java-lang-nullpointerexception-attempt-to-invoke-virtual-method/103870/2 "2024-03-16T12:14:32Z")

</div>

Closed on March 16, 2024, 12:14pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
