Reputation: 578
After a random run, without changing anything, the app I'm developing is no longer running on my phone. I gave it some thought and finally decided to test it on another device only to find out that it works perfectly. Emulators work as well. This is a big bottleneck in my development since I can only use emulators as of now.
This is the error that I'm getting:
Error while executing: am start -n "com.university.hobi_android/com.university.hobi_android.ui.main.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.university.hobi_android/.ui.main.MainActivity }
Error type 3
Error: Activity class {com.university.hobi_android/com.university.hobi_android.ui.main.MainActivity} does not exist.
Android Studio 3.5.1.
Device is running Android Pie
Here is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.university.hobi_android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.main.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Upvotes: 0
Views: 522
Reputation: 578
I figured it out in the end. What I had to do was to go into the build.gradle
file of my module and change the applicationId
, versionCode
and versionName
properties. It still doesn't run from android studio for some reason but it installing the app and running it off my phone works now.
Upvotes: 0
Reputation: 1825
You need to follow the below steps.
Note:- Also, Disconnect the physical device and reconnect the device.
Upvotes: 1