Search code examples
androidpaypalbraintree

BraintreeBrowserSwitchActivity missing error


I am trying to test processes payment with PayPal and I got an error when trying to open BraintreeFragment.

Error: BraintreeBrowserSwitchActivity is missing, incorrectly configured in AndroidManifest.xml or another app defines the same browser switch URL as this app. See the link for the correct configuration

<activity 
    android:name=".payment.BraintreeBrowserSwitchActivity"
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="com.entage.nrd.entage.braintree" />
    </intent-filter>
</activity>

try { 
           mBraintreeFragment = BraintreeFragment.newInstance(this, clientToken);
           // mBraintreeFragment is ready to use!

           PayPalRequest request = new PayPalRequest("1")
                   .currencyCode("USD")
                   .intent(PayPalRequest.INTENT_AUTHORIZE);
           mBraintreeFragment.addListener(this);
           PayPal.requestOneTimePayment(mBraintreeFragment, request);

       } catch (InvalidArgumentException e) {
           // There was an issue with your authorization string.
       }

Solution

  • Likely you need the fully qualified name:

    <activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
        android:launchMode="singleTask">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="${applicationId}.braintree" />
        </intent-filter>
    </activity>