Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

java.lang.NullPointerException: getSurface(...) must not be null

Open
#1,603 23 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
18/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, java, kotlin
Domain
mobile

Research direction

The crash comes from the null check on the surface passed into GenericFromFile, which is built from an OpenGlView added to a parent view at runtime. Start with how GenericFromFile receives and validates that surface, then check when the OpenGlView's surface is actually created and whether it can be null at that moment. Done would mean the file push no longer crashes when the view is not yet ready. This needs Android view lifecycle knowledge and the thread has no agreed fix, so treat it as a hard first issue.

Written by the indexing model from the issue text.

Description

bug help wanted

When I use GenericFromFile and push local files, I get
java.lang.NullPointerException: getSurface(...) must not be null
I can confirm that I have implemented the method according to the steps in the document,
surfaceView = OpenGlView(context!!)
bindingFloatWindow?.frameSurfaceView?.addView(surfaceView)
genericFromFile = GenericFromFile(openGlView, this, this, this)
It sometimes works, but sometimes it doesn't, and the above error will appear

微信截图_20241013114136

Dominant language
Kotlin
Stars
3k
Forks
946
Avg merge
4d 6h
Merged PRs (30d)
9

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pedroSG94/RootEncoder

All issues in pedroSG94/RootEncoder

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.