dimanche 19 octobre 2014

There are multiple apps registered for the AuthActivity URI scheme - Dropbox sync issue on Android


Vote count:

0




Sorry for my poor English and the fact I am a newbie on Android development.


I'm developping an Android app which should send data to the datastore of Dropbox. My problem is, when my code is getting this line:



mAccountManager.startLink(DropboxHelper.this,REQUEST_LINK_TO_DBX);


Then my logcat send me the message below:



10-19 10:40:32.411: W/com.dropbox.client2.android.AuthActivity(28381): There are multiple
apps registered for the AuthActivity URI scheme (db-qeojdcjk0dkkswc). Another app may be
trying to impersonate this app, so authentication will be disabled.


The closer explanation I have found is this one: Android + DropboxSync startLink


But the comments have not helped me.


Here my code :



public class DropboxHelper extends ActionBarActivity {

// *** Objects and APP_KEY + APP_SECRET are instantiate here ***

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dropbox_activity);


// Set up the account manager
mAccountManager = DbxAccountManager.getInstance(getApplicationContext(), APP_KEY, APP_SECRET);

mUnlinkButton = (Button) findViewById(R.id.unlink_button);
mUnlinkButton.setVisibility(View.GONE);


// Button to link to Dropbox
mLinkButton = (Button) findViewById(R.id.link_button);
mLinkButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {

if ( mAccountManager.getLinkedAccount() == null )
mAccountManager.startLink(DropboxHelper.this, REQUEST_LINK_TO_DBX);
else
{
Toast.makeText(DropboxHelper.this, "Connection déjà établie, vous pouvez vous déconnecter si vous le souhaitez", Toast.LENGTH_LONG).show();

mUnlinkButton.setVisibility(View.VISIBLE);

}
}
});

mUnlinkButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {

mAccountManager.unlink();
Toast.makeText(DropboxHelper.this, "Déconnecté", Toast.LENGTH_LONG).show();

}
});

// Set up the datastore manager
if (mAccountManager.hasLinkedAccount()) {
try {
// Use Dropbox datastores
mDatastoreManager = DbxDatastoreManager.forAccount(mAccountManager.getLinkedAccount());
mLinkButton.setVisibility(View.GONE);

} catch (DbxException.Unauthorized e) {
System.out.println("Account was unlinked remotely");
}
}
if (mDatastoreManager == null) {
// Account isn't linked yet, use local datastores
mDatastoreManager = DbxDatastoreManager.localManager(mAccountManager);
// Show link button
mLinkButton.setVisibility(View.VISIBLE);
}
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_LINK_TO_DBX) {
if (resultCode == Activity.RESULT_OK) {
account = mAccountManager.getLinkedAccount();
try {
// Migrate any local datastores to the linked account
mDatastoreManager.migrateToAccount(account);
// Now use Dropbox datastores
mDatastoreManager = DbxDatastoreManager.forAccount(account);
// Hide link button
mLinkButton.setVisibility(View.GONE);
} catch (DbxException e) {
e.printStackTrace();
}
} else {
// Link failed or was cancelled by the user
}
} else {
super.onActivityResult(requestCode, resultCode, data);
}



}

}


I can't figure out How to solve this issue, I really thank you If you can help me.


Best regards.



asked 45 secs ago







There are multiple apps registered for the AuthActivity URI scheme - Dropbox sync issue on Android

Aucun commentaire:

Enregistrer un commentaire