简体   繁体   中英

Handling DropBox with different Build Variant

I'm facing an issue with dropbox in my 2 apps. in fact I have 2 build variants and to be able to handle different secrets for both apps I use Gradle to inject the value into the manifest but for dropbox, i always have this error

The installation did not succeed.
The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER

what I did is I added in the manifest dropboxAppKey in the scheme attribute

        <activity
            android:name="com.dropbox.core.android.AuthActivity"
            android:configChanges="orientation|keyboard"
            android:launchMode="singleTask"
            >
        <intent-filter>
            <data android:scheme="db-${dropboxAppKey}" />

            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

and in Gradle i inject the app key corresponding to each flavor

 App1 {
          manifestPlaceholders = [dropboxAppKey : "123456"]
       }
 App2 {
          manifestPlaceholders = [dropboxAppKey : "654321"]
       }

but I got always the same error INSTALL_FAILED_CONFLICTING_PROVIDER

It sounds like you need a distinct app key for each variant (so, a total of 4 app keys in this case; 2 per app) in order to disambiguate each app variant.

Open a Dropbox API ticket from the account that owns the apps and we can add an extra app key/secret to each of your apps:

https://www.dropbox.com/developers/contact

That way, you can use a distinct key in each variant.

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