0

I got problem when change name packages in android studio,

first i use some open source project, then when i want to change the previous packages some of function cant be used, the error message is "ClassNotFoundException:yuku.kpri.model.Song" even thoughni already change packages "yuku" to "buna" and all packages that related to "yuku" change to "buna" and also packages "yuku.kpri.model.Song" changes to "buna.kpri.model.Song" but the code still run to yuku.kpri.model.Song,

I already try many solution like

  1. Close/Unselect Compact Empty Middle Packages ,Then right click your package and rename it. Here
  2. Clean Project
  3. Rebuild Project
  4. change the applicationId Here

Error Message when try to use the function Here

Help me to solve this problem, what i miss and my mistake... im looking for your answer

Zee
  • 11
  • 4

2 Answers2

0

One thing you could try is selecting File --> Invalidate Caches/Restart, sometimes it works magic.

Maya McKela
  • 172
  • 2
  • 5
0

This could be a Proguard issue.

Try to set "minifyEnabled false" for both Release & Debug build types in your projects build.gradle file :

buildTypes {
    debug {
        minifyEnabled false
    }
    release {
        minifyEnabled false
    }
}

If this works, you should exclude the class in the proguard-ruls.pro file.

  • it say "Removing unused resources requires unused code shrinking to be turned on. See http://d.android.com/r/tools/shrink-resources.html for more information." when i do that, whats next? – Zee Jul 22 '18 at 14:57
  • still, when i already do your answer still have the same error, – Zee Jul 22 '18 at 15:07