0

After I have been developing for quite some time m android application, I decided to change the package name. What I did was:

  1. renamed the package tag in manifest

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="la.lala.lalala">
    
  2. refactored the packages in the project treeview in AS

  3. An successfully built the project. Now when I am trying to run in on my device I get this error

    Starting: Intent { act=android.intent.action.MAIN cat=
    [android.intent.category.LAUNCHER]
    cmp=**old.app.package_name**/**new.app.package_name**.controllers.ui.SplashActivity }
    Error type 3
    Error: Activity class    
    {**old.app.package_name**/**new.app.package_name**.controllers.ui.SplashActivity} does not exist.
    

In case you didn't understand the problem is that instead of running

new.app.package_name.controllers.ui.SplashActivity

it is trying to run

old.app.package_name/new.app.package_name.controllers.ui.SplashActivity

I cannot understand why since I did refactored it properly. I have also tried to restart and invalidate caches but this didn't work either.

Libathos
  • 3,340
  • 5
  • 36
  • 61

1 Answers1

0

Ok I fixed it after some googling and some tinkering with it. Thanks to this thread, I checked my build.gradle files. Found out that i was importing

apply plugin: 'android-library' 

which was deprecated, replaced it with

apply plugin: 'com.android.library'

and it worked correctly :)

Community
  • 1
  • 1
Libathos
  • 3,340
  • 5
  • 36
  • 61