App is not installed after changed applicationId - android

I'm new to Android development.
I finally finished up my first android application and
tried to upload on google play.
then I found out I can't use com."example" package name for uploading.
so I already changed all my package name to com."◯◯◯" and it worked fine.
but once I changed applicationId in gradle app file which corresponds to the package name, my app is not installed any more...
there's no error message in android studio and seems to fine.
I did clean and rebuild, invalidate caches/restart, uninstall existing app on my device, etc..but any of them not working.
I couldn't find any solution for it. please help me to fix this problem.
thank you
---update. case solved---
It was because if you change the applicationId, the installed app is brand new one(doesn't have any data in the database). so the problem was null variable which I didn't make it nullable.
thank you for your help.

change all place-name where package name use it then try

Related

Creating a debug app

Okay so i have an application, put up on the playstore.
What i want now, it to create the same application but with debug postfix in the name and it must have everything same.
I want to do this, because i do not want to disturb my original project when i am experimenting stuff,
So what i did was, i copied the project folder from wherever it was to the desktop, original one had the package name com.femindharamshi.spa so i refactored the whole thing to com.femindharamshidebug.spadebug and all changed the app_name in string
but when i try to open this app in the emulator, Android Studio Gives me the following error :
Installation failed with message Failed to finalize session :
INSTALL_FAILED_INVALID_APK: Split_lib_slice_4_apk was defined multiple
times. It is possible that this issue is resolved by uninstalling an
existing version of the apk, if it is present, and then re-installing
Also i do not want to uninstall the original app from the emulator/physical device, i just want to add this app for testing purposes. What should i do ?
Try closing the Android Studio and giving clean and build to the project.
change you application ID in app level build.gradle file and sync the project
applicationId "//pkg id here"

Changing Firebase Package Name

I have a app with Google Sign-In integrated with Firebase. I recently changed app package name for release purpose. and now running throwing this error:
Error:Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name '<Package Name>'
So I am guessing Firebase cant recognize app with the new package name. How can I change Firebase package name. I have gone through Firebase console but can't find any changing package settings. Or is there any good way to achieve this instead of creating new project with package name and code again? Any help would be appreciated.
As Eurosecom commented, you can just add a new Android app to your existing Firebase project with the new package name. After doing this, download the updated google-services.json and add it to your app.
Note that Firebase does not use the actual package name from your Java code, but uses the applicationId from your app's build.gradle file:
defaultConfig {
applicationId "com.firebase.hearthchat"
When you initially create a project in Android Studio, the package name and application id will have the same value. But if you refactor your code into a different package, the application id won't be updated. That explains why the app will continue to work after such a refactoring. But it can be confusing at times, which is why I prefer keeping them in sync.
If you are using Firebase assistant then:
Delete your app in the Firebase console in the project settings.
Back in Firebase assistant reconnect to the Firebase for any service.
It will ask you to sync with the project. Click on Sync.
The app with new package will be added and the google-services.json file will be automatically updated.
Also note that the package name of the applicationId value in the build.gradle file is considered.
Cheers
There's a better way of resolving this issue.The error can be as result of you having a GoogleService Json file in your app folder, All you need to do is; try and locate your google-service.json file under app folder, and change the package_Id to the new package_id you have created; Save, Do a Clean and Rebuild Project, your problem would be resolve. Hope this will help you. It works for me. You can kindly votes if this also help you. Thanks

how to installed apk without uninstalling the current apk of the same App

I used to work with Android studio 1.4. yesterday I downloaded the newest version of android Studio 2.1.2 and it did not work well for me, so i reverted to Android studio 1.4.
the problem is, when i tried to run my App, I received a message telling me, "that the apk is already installed on the phone and to reinstall it i have to uninstall the version that is already on the phone".
Actually, I can not uninstall the apk version that is currently on the phone because it contains a huge database, and if i uninstalled it, then the databse content will be lost and i have to do it from the beginning
is there any other solution to run the App "apk" without uninstalling it
i am getting this message:
The easiest and the fastest way is to change application package name.
An appropriate way to do what you want would be to use ProductFlavours.
You start by adding the following to your app's build.gradle:
android {
productFlavors {
dev {
applicationId "com.yourapp.dev" //one in development mode
}
prod {
applicationId "com.yourapp" //the package name for your released app
}
}
}
You can add parameters different for the dev and production apk(s) as BuildConfig fields.
Do study more about it, will be able to implement it in the way you want. You can start with
Mastering product flavours on android
Just change the applicaitonId property in the app module's build.gradle.
Change version code and version name in build.gradle.
Hope this will help you.
1-First of All Please Change Your Current Application Package name
2-Build The Application
3-We can't use same package name in android
4-Work Will File after completion this steps.
Just change the applicaiton's Id property which is located in the app module's build.gradle.

Modified package of my project, but the change doesn't affect the application

I accidentally created a new project within a package like "companyname.applicationname". So I forgot the top level domain. It should be "de.company.application".
I managed to modify my project. I changed the package in my manifest, and also all paths and file locations which needed to be changed for the project to no longer give me errors.
So in Android Studio everything looks fine. But if I install the app on my phone, the package is still "company.application".
Have I missed any occurence of "company.application" in my app which need to be changed?
You must have forgot to change applicationId in your build.gradle

Why is Android studio having problems with capitalized package names?

I have an app that started in eclipse. The package name starts with a capital, and it always compiled and installed correctly. Now that I have moved the project into android studio, while the app will compile, it won't install due to a malformed manifest. I looked up this problem, and the suggestion was to lowercase the package name. This dose solve the problem, and the app installs, but this makes no sense. Why would apps compiled in eclipse be fine with it, but the same code in Android Studio not work? This is a large problem, as the app is already in the play store, and I can't lowercase the package name, so I'm stuck in eclipse. Dose anyone know a work around?
Maybe google play is not case sensitive and thats why it doesn't recognize the upercase package name, you might be able to post an update with the same package name but lowercase. Have you tried it?
Had the same problem with capitals in old package name. In studio simply rename the package in build.gradle (Module:app) from com.abc.example to com.ABC.example sync the project and all should be well.
In Android Studio rename the package name and in build.gradle leave old applicationId.
Although your project's package name matches the application ID by default, you can change it. You should never change the application ID.
More: https://developer.android.com/studio/build/application-id.html#change_the.package_name

Categories

Resources