8

I am trying to get my app ready for alpha testing and am struggling to rename my project packages - as it would appear that com.android is a restricted package name - however when following the instructions outlined here I get the following message:enter image description here - I'm...not sure what to do here as this window differs from what is given in the instructions. Has anyone encountered this and is able to help me?

secondubly
  • 983
  • 5
  • 18
  • 43

2 Answers2

3

I found the trick/method for changing project package name after wasting $12 on the fiverr. This method works for me in Android Studio 4.0.

You just need to change this line only in build.gradle(app level).

applicationId "codetrix.cleaner"

Just change the text in " " quotes. Your new package will be your updated text.

Tariq Mahmood
  • 147
  • 15
  • 1
    awesome! it's been a while since I've looked over this but I'll go ahead and mark this as the answer hoping it helps others – secondubly Jun 17 '20 at 19:17
0

If you want to change your package name, please follow below steps:

  1. Change your package name in AndroidManifest.xml: package="your_new_package_name"

  2. Rebuild project, you have to fix many import of R file.

  3. Change the package name of java by Right click -> Refactor -> Rename on the package. This is an optional step, #1 and #2 should change your package name already.

Cao Minh Vu
  • 1,900
  • 1
  • 16
  • 21
  • Unfortunately, that didn't help as I still seem to be getting compilation errors (unrelated to this) - I think I'll just go the nuclear option and make an entirely new project and copy everything over line by line - save myself the headache. I appreciate the help though. – secondubly Mar 23 '18 at 03:46
  • yes, it is a brute-force way, slow but definitely success. – Cao Minh Vu Mar 23 '18 at 03:50
  • Hey, I am facing same problem, did you get it? – Tariq Mahmood Jun 13 '20 at 03:48
  • @TariqMahmood unfortunately I did not! I ended up just remaking the project entirely and recopying everything - it's a bit extreme but it did fix it. – secondubly Jun 14 '20 at 16:44