0

I renamed my package this way:

Another good method is: First create a new package with the desired name by right clicking on the java folder -> new -> package.

Then, select and drag all your classes to the new package. AndroidStudio will refactor the package name everywhere.

Finally, delete the old package.

Done.

When I debug app or run app on my device everything's working fine. But when I try Generate Signed APK there's error: Picture

I believe it has something to do with this:

good method but had to do 2 more things(other than updating manifest file) to make it completely work, firstly had to change/rename the R file imports in whole project and secondly appdebug was using old package name( visible in run window of studio) added applicationId "com.packagename" in app build.gradle defaultconfig

But I don't know what means "change/rename the R file imports".

Everything's fine but "cannot find symbol variable". That's strange becouse when I see code everything's fine: Picture2

It seems that every "R.id.something" I have in code is wrong. But there's no problem when I build debug apk, only with signed apk.

I tried Clean Project, Rebuild Project, Invalidate Cache/Restart, even restarted my pc.

There are 40 errors, same problem in all classes: Picture3

Community
  • 1
  • 1
  • Possible duplicate of [Android Studio Rename Package](https://stackoverflow.com/questions/16804093/android-studio-rename-package) – Amir Dora. Jul 17 '18 at 04:45
  • as you said you moved files to another package.. i think you should check the package name of all moved files is correct or not... all associated classes where you used these classes check the import lines – TejpalBh Jul 17 '18 at 05:01

1 Answers1

0

1 ) close your studio
2 ) go to the Project_Name\Module_Name\build\outputs\apk\
3 ) delete that apk
4 ) restart android studio and go to Build>Generate Signed APK

urvi joshi
  • 158
  • 13