Thursday, 31 August 2017

Android Studio Package Renaming Error and App Launch Problem

The Problem:
If you rename a package name in Android Studio and run the application, you won't be able to launch the app from Android studio and you need to manually click on app on your device to open
The error you come across is as follows:
Error type 3:
Error: Activity class {com.mycompany.myapplication/com.mycompany.testapp.MainActivity} does not exist.

To overcome this problem, follow the solutiion below:

The Solution:
If you are using Android Studio in Linux OS (Ubuntu, etc.,) , you can safely
  1.  Remove the directory .gradle/caches (use Ctrl+H to show hidden files and folders).
  2.  Click on "Sync Project with Gradle Files" icon on the toolbar of the Android Studio
  3.  Then Build -> Rebuild Project in Android Studio.
That's it. Now the app will be rebuild and you can easily launch your app from Android Studio without any errors and stuff.

Note: If you still got issues, comment below.

No comments:

Post a Comment

Install Jar Files in Ubuntu

How to Install Jar Files in Ubuntu To install a jar file in ubuntu and its flavored OS:  Steps : Open Terminal (Ctrl+Alt+T) Sy...