0

I know that almost identical question was asked here, but accepted answer doesn't work for me.

Make apk with Capitalized package name in android studio

Let me explain.

Our Android app was developed in Xamarin.Android, we did a mistake with package naming - Visual Studio and Xamarin configured our's app manifest with uppercased package name (this was a mistake which now I pay with my sanity). It worked for Xamarin version, but we decided to rewrite that app in Android Studio after some releases. Now the problem begins...

We are not able to directly deploy/install apk on devices older than Android 8.0, we get following error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

It's funny that issue does not exists on devices with newest API.

It's clearly issue with our package name which is something like: YES_We_Failed_On_It.We_Failed_Very_Badly

If I change it to lowercased everything works, but the case is we can't release another application with different package name.

Is there any possibility to fix this?

1 Answers1

0

It will be self answer question.

If anyone else will be at my position, fix is quite simple.

As mentioned in docs: https://developer.android.com/studio/build/application-id.html

When you create a new project in Android Studio, the applicationId exactly matches the Java-style package name you chose during setup. However, the application ID and package name are independent of each other beyond this point. You can change your code's package name (your code namespace) and it will not affect the application ID, and vice versa (though, again, you should not change your application ID once you publish your app).

Application ID and Java package name are not the same.

So to fix this I renamed my package to be lowercased and stayed with uppercased Application ID. Problem disappeared.

At the end of build, build tools copy our Application ID into final APK's manifest, that's why it's still the same package I think.

Also from docs:

One more thing to know: Although you may have a different name for the manifest package and the Gradle applicationId, the build tools copy the application ID into your APK's final manifest file at the end of the build.