Unfortunately, app has stopped.
I get this error when I'm running my application in the emulator. Why? My program doesn't contain any error, but it's not running.
I use Eclipse with SDK.
Here is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.jvstgs"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".Tetris"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And my LogCat
06-09 07:30:20.989: D/AndroidRuntime(627): Shutting down VM
06-09 07:30:20.989: W/dalvikvm(627): threadid=1: thread exiting with uncaught exception (group=0x40a122a0)
06-09 07:30:21.049: E/AndroidRuntime(627): FATAL EXCEPTION: main
06-09 07:30:21.049: E/AndroidRuntime(627): java.lang.RuntimeException: Unable to resume activity {com.example.jvstgs/com.example.jvstgs.Tetris}: java.lang.SecurityException: Neither user 10044 nor current process has android.permission.WAKE_LOCK
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2575)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2603)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2089)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.ActivityThread.access$600(ActivityThread.java:130)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.os.Handler.dispatchMessage(Handler.java:99)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.os.Looper.loop(Looper.java:137)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.ActivityThread.main(ActivityThread.java:4745)
06-09 07:30:21.049: E/AndroidRuntime(627): at java.lang.reflect.Method.invokeNative(Native Method)
06-09 07:30:21.049: E/AndroidRuntime(627): at java.lang.reflect.Method.invoke(Method.java:511)
06-09 07:30:21.049: E/AndroidRuntime(627): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
06-09 07:30:21.049: E/AndroidRuntime(627): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
06-09 07:30:21.049: E/AndroidRuntime(627): at dalvik.system.NativeStart.main(Native Method)
06-09 07:30:21.049: E/AndroidRuntime(627): Caused by: java.lang.SecurityException: Neither user 10044 nor current process has android.permission.WAKE_LOCK.
06-09 07:30:21.049: E/AndroidRuntime(627): at android.os.Parcel.readException(Parcel.java:1425)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.os.Parcel.readException(Parcel.java:1379)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.os.IPowerManager$Stub$Proxy.acquireWakeLock(IPowerManager.java:288)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.os.PowerManager$WakeLock.acquireLocked(PowerManager.java:309)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.os.PowerManager$WakeLock.acquire(PowerManager.java:288)
06-09 07:30:21.049: E/AndroidRuntime(627): at com.example.framework.impl.GLGame.onResume(GLGame.java:66)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1184)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.Activity.performResume(Activity.java:5082)
06-09 07:30:21.049: E/AndroidRuntime(627): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2565)
06-09 07:30:21.049: E/AndroidRuntime(627): ... 12 more
It looks like the problem is with your permissions:
Update your manifest to include this line:
Your Stack Trace
Btw, the reason everyone is able figure out your problem so quickly, is because your logcat clearly shows what your error is.
Read this post to learn more about how to read a stack trace.