Fatal Exception IllegalStateException. Could not execute method of the activity

55 views Asked by At

Ok so I wrote code that will play songs from my library. I was successful in adding the tracks to the application, but when I click on a track for playback i get this error "Fatal Exception IllegalStateException. Could not execute method of the activity" StackTrace

What could be the reason for this type of Exception? Thanks.

1

There are 1 answers

1
user3078406 On

Found "a" solution to this NullPointerException. I debugged line 150, which was null and traced it back to the name of the file you declare in the manifest file. Watch for the name of the package and the way you wrote code in the manifest file. I fixed this error because I realized that the service declaration in the manifest file was missing a portion of the package name for my application. In my case I was missing the ".android" in my manifest declaration. I had

when it should have been

Audio files now play without a problem.