Install duplicated Android app on your device - android

I want to install on my phone the production and development apks of my Android app, which initially are going to be exactly the same.
The only thing that I have changed so far is <application android:label="#string/app_name"> in the AndroidManifest.xml to a different string.
However, when I try to install the new APK on my device, it detects the app as an update of the production one.
What can I do to make my phone understand that these are two different apps?

You have to change the applicationId of the app.
That is used as a unique identifier in the play store and on your phone.
The applicationId is in your build.gradle in the main app folder:
defaultConfig {
applicationId "com.example.myapp"
During the build gradle will generate the package name in your manifest from the applicationId.

You have to change to package name of application. Then you can easy to install application different one.
com.something.somthing set on you application package.
Change at project/src/com.package.package
And chnage at manifest

Related

Two Diffrent application not installing in single device

I created two different application but when when i am installing both application in single device one is replacing other
please check package name of both application
The package name should not be identical
Its because your applicationID is same in both application.
Check your applicationId inside your app's build.gradle file. and make them unique in both of your application.
This can happen if the application IDs are the same for both apps - they must be different. Check the applicationId property in the build.gradle files of both apps.

Android applications with differnt package names are not able to install in same device.

I created two apk files with package name com.example.a and com.example.a.staging. But I am not able to install the both on the same device together. It will install separately.While try to install one after installed the other, it shows an error 'app not installed'
i have faced similar situations.
possible scenarios:
1.you didn't change applicationId in app/gradle.
Solution: In that case, change applicationId.
2.you have a defined a provider for facebook(or something similar) in AndroidManifest.xml like android:authorities="com.facebook.app.FacebookContentProviderXXXX.
Solution: Comment out that provider for testing or add different ids for providers for different build variants.
first, you change package name in your manifest file, then you paste the changed package name to your build.gradle(app level) on applicationId place

Google play throws a message (see below) when I try to upload signed app release .apk file

I am trying to upload an app to Google play from the Google play developer console, and it throws the following message when I try to upload an apk file: "You need to use a different package name because "com.example" is restricted." The package that my app's classes belong to is called com.example.myname.converter. What is the best way to fix the problem without messing things up?
In Android studio build gradle file change the package name.
The defaultConfig like this
applicationId "com.example.android.applicationname"
change that com.example package name
applicationId "com.yourcustomname.yourcustomname.applicationname"
then clean and rebuild project
You need to specify a valid appId. An appId like com.example is, for sure, not the correct one.
For instance, if you app is from Facebook an app id like com.facebook.app is the correct choice.
Se more information about the appId here.
For updating your app id, just go to your app build.gradle and change the field applicationId.

How to build 2 apps with the same project in android studio?

I've recently just imported my eclipse project into Android Studio, I haven't convert it into gradle yet. So some forum that offers me solution from gradle is not working. My problem is I have 2 application, where both has some slight difference. I want to use the same project when I deploy the application. I've tried to change the project name but that doesn't help. The moment the new application is installed, the previous version is overwritten. I thought of making some changes to the Manifest file(not sure if this is the right thing to do) but in android studio, I can't seem to locate where the file is. Please help.
Regards,
Dexter
Your application needs to have a different package name for it to be treated as a different app.
So instead of
com.yourcompany.apps.yourapp
You write
com.yourcompany.apps.yourapp1 and
com.yourcompany.apps.yourapp2
You can do that in your AndroidManifest.XML in the manifest tag
package="com.yourcompany.apps.yourapp1"
Also, instead of 2 separate apps, try seeing if you can solve this using Build variants and product flavors.
Use flavors on your build.gradle
productFlavors {
flavorName {
minSdkVersion 19
applicationId 'you.package.name'
targetSdkVersion 23
versionCode 1
versionName 'version_name'
}
}
Also you can modify a file with different changes by just adding a source folder for the flavor.
app
|--src
|--main
|--flavorName

"com.example is restricted" when uploading APK to Play Store

I am trying to upload my finished android app to the android market and I am getting this error:
You need to use a different package name because "com.example" is restricted.
In Android Studio after renaming Package then go "build.gradle (Module:App)
defaultConfig {
applicationId "com.example.android.abc"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
change the line
applicationId "com.example.android.abc"
to
applicationId "com.tanxe.android.abc"
relpace "tanxe" with the word you want or your Organization name i.e.
your new package name
and rebuild the project
The best way to solve this is by going to the AndroidManifest.xml: package="com.example.android.yts"
Cursor on example
press
Shift+f6
change Package name eg. example to boss
Click on refactor now `"com.boss.android.yts"``
2nd thing
open build.gradle (module:app) change applicationId "com.example.android.yts"
to "com.boss.android.yts"
The error message is telling it all. You need to use a package name of your own. The package name is the identitiy of the application.
To rename the package name, In eclipse right click on the project in project explorer. Then Android Tools > rename Aplication Package name. Then enter the new package name.
Also make sure that you are trying to upload a release build
Yes, com.example is the default package name for Android applications and is, as such, just a placeholder. You should replace it by a unique package name before uploading it to the Google Play Store. It doesn't particularly matter what it is, but it should relate to your application, cannot match any existing package name (so picking someone else's package name like com.android is not a good idea), and cannot be changed after publishing.
Double-tap **package** from AndroidManifest.xml, refactor-> rename.
Go to build.gradle and change applicationId under defaultConfig.
If you have google-services.json, go to google-services.json and rename package_name in two places.
That should work.
Write something else than the com.example
for ex:
com.gg.s etc will do(make that onj your name/firm name)

Categories

Resources