While rebuilding an Android Project after some build file losses due to SVN misconfiguration, I encountered an error on launch:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.bla.logintest/com.example.bla.logintest.MainActivity}: java.lang.SecurityException: getDeviceId: Neither user 10053 nor current process has android.permission.READ_PHONE_STATE.
As the original AndroidManifest.xml was lost due to SVN (missing ignores), I reckoned the problem might be solved by adding <uses-permission android:name="android.permission.READ_PHONE_STATE" />
. Unfortunately, it seemingly does nothing as I get the same error again on launch!
Here is my AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bla.logintest" >
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main_menu" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MenuActivity"
android:label="@string/title_activity_start"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.bla.logintest.MainActivity" />
</activity>
<activity
android:name=".EditDB"
android:label="@string/title_activity_edit_diags"
android:parentActivityName=".MenuActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.bla.logintest.MenuActivity" />
</activity>
<activity
android:name=".EditAnswers"
android:label="@string/title_activity_edit_questions"
android:parentActivityName=".MenuActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.bla.logintest.MenuActivity" />
</activity>
</application>
</manifest>
Any suggestions where the error could be?