Skip to content Skip to sidebar Skip to footer

Android Overflow Menu Nullpointerexception When Clicking Three Dots

The normal button works fine, but clicking the three dots button makes an exception @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.m

Solution 1:

after doing an exhaustive research, I found this answer here: App Crashes on Clicking Options

That answer solved my issue, aparently the issue is only for the Gradle version 2.3.3 and you need to downgrade to the 2.2.3 in order to fix it. (Hope that soon fix this bug to upgrade)

Here I paste the solution provided by Alex Bouroff

The solution that I have found was downgrading Gradle plugin from 3.3 down to 2.14.1

1) Replace the plugin version in top-level build.gradle:

dependencies {
    //REPLACED 2.3.3->2.2.3(MENU ISSUE)
    //classpath 'com.android.tools.build:gradle:2.3.3'
    classpath 'com.android.tools.build:gradle:2.2.3'
    ...
    }

If you use a wrapper 2) delete the /gradle/wrapper/gradle-wrapper.jar

3) replace the contents of /gradle/wrapper/gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

build-> clean project -> rebuild project -> the crash when acessing three-dot upper-right corner menu had gone.

Post a Comment for "Android Overflow Menu Nullpointerexception When Clicking Three Dots"