Reputation: 435
I made an app (com.example) using Android Studio 2.2. This app displays a logo (PNG image) on the main activity. Now i want to make a new package of the same app in order to install both on my device. there are two differences: the logo and the label. i tried to change the package name in manifest, from:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
to
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.newLogo">
sadly it break all
import static com.example.R.string.MyGreateString;
references. is there a smart way to avoid the rename of all imports or to rename a package?
Upvotes: 0
Views: 75
Reputation: 1394
go to File>Project Structure> app>Flavors tab and change or add (+) the Application Id
Upvotes: 0
Reputation: 5470
Create a gradle flavor for each build type in each app (see documentation for an explanation) and define an applicationId for each flavor:
productFlavors {
A {
applicationId "com.example.newLogo"
}
B {
applicationId "com.example"
}
}
Upvotes: 2