I was developing on my real device Xiaomi Mi 4c, no problems. Then suddenly (I guess after a system update) I ran into this error, when I try to run:
Uploading file to: /data/local/tmp/be.sebsob.red
Installing be.sebsob.red
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/be.sebsob.red"
Aborted
Launching application: be.sebsob.red/be.sebsob.red.FullscreenActivity.
DEVICE SHELL COMMAND: am start -n "be.sebsob.red/be.sebsob.red.FullscreenActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=be.sebsob.red/.FullscreenActivity }
Error type 3
Error: Activity class {be.sebsob.red/be.sebsob.red.FullscreenActivity} does not exist.
(This is a new android studio default fullscreen app, without any changes)
Things I tried but did not solved the problem:
- Cleaned/Rebuild the project
- Re-imported the project
- Deleted the Build directory
- Deleted the ~/.idea and ~/.gradle directories
- Deleted .iml files
- Changed activity naming in Manifest.xml from .FullscreenActivity to full path
- Restarted my phone / computer / Android Studio
- Restarted Android studio with Invalidate Caches / Restart...
- Restarted adb via adb kill-server and adb start-server commands
- Killed abd process via Task Manager and restarted
- Re-enabled developer options on my phone
- Revoke USB debugging authorizations on my phone
BUT When I run this application on my other device (Xiaomi Mi2S) it works fine.
AND When I copy the .apk manually on my phone (where it fails to run from Android Studio) it installs and runs fine. So I guess it has to be a problem specific when running from Android Studio to my phone? Could It be a read/write access permission error? Any idea's?
AndroidManifest.xml (default, did not change after Android Studio new project setup)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="be.sebsob.red">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".FullscreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
build.gradle (Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "be.sebsob.red"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
}
Thanks