secondubly
secondubly

Reputation: 1032

Package contains directories which cannot be renamed

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?

Upvotes: 8

Views: 3143

Answers (2)

Tariq Mahmood
Tariq Mahmood

Reputation: 530

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.

Upvotes: 3

Cao Minh Vu
Cao Minh Vu

Reputation: 1950

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.

Upvotes: 0

Related Questions