简体   繁体   中英

Crashlytics Beta build for Android will not install if production build exists: 'The package conflicts with an existing package by the same name'

Our team distributes beta build through Crashlytics and most of us have the production build installed on our phones. We aren't able to install the beta build without removing the production app. (Both builds have different applicationId, as in: prod: com.abc beta: com.abc.beta )

We tried using the same keystore (as production) and also a different one to sign the beta build, but it doesn't change anything.

Is there a way to install both beta and production builds on the same device?

After investigating the issue for some time, and thanks to the help from the Fabric team, I've managed to found the issue and also a way to resolve it.

Using adb logcat , I've found the underlying error of the failure:

Package attempting to redeclare permission com.abc.permission.C2D_MESSAGE already owned by 

It appears that the beta app is trying to write to the same permission file that's owned by the production build. To avoid that, I edited my AndroidManifest.xml as follows:

<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />

So that the beta app has its own permission folder to write to.

Hope this helps someone out there!

Mike from Fabric here. There is an Apple restriction that only allows Testflight or Mobile Device Manager's from installing an app with the same bundle id, so we're prevented from installing over a version installed from the App Store if the bundle id is the same. For example, you couldn't install a beta production version of the app over the App Store production version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM