AndroidManifest exception with PayPal
See original GitHub issueGeneral information
- SDK/Library version: 3.2.0
- Environment: Sandbox
- Android Version and Device: Android 6.0 Nexus 5 Emulator (x86_64)
Issue description
I’m trying to implement braintree using drop in UI in xamarin.forms. By doing so I created a dependency service to use the respective code for iOS or Android. Starting out with the android implementation, I started with getting a package of bindings that allow me to call the functions in Android v2 SDK. Everything seem to work except for PayPal Integration.
attempting to click on the paypal button will not result in any activity appearing and onActivityResult gets called with a first user result code with the exception Com.Braintreepayments.Api.Exceptions.BraintreeException: BraintreeBrowserSwitchActivity missing, incorrectly configured in AndroidManifest.xml or another app defines the same browser switch url as this app. See https://developers.braintreepayments.com/guides/client-sdk/android/v2#browser-switch for the correct configuration
Not being able to debug into why I got the exception I was able to emulate the checks - isManifestValid
Within isManifestValid
I was able to retrieve the ActivityInfo
for BraintreeBrowserSwitchActivity
and it only returned false because AppHelper.isIntentAvailable(fragment.getApplicationContext(), intent)
is false
Within isIntentAvailable
context.getPackageManager().queryIntentActivities(intent, 0)
returned an empty list making me think that the Intent is not registered to use any activity despite having declared the URL scheme in my AndroidManifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.3.16" package="com.company.abcmobileapp.android" android:installLocation="auto" android:versionCode="24">
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
<application android:debuggable="false" android:label="ABC" android:theme="@android:style/Theme.Holo.Light" android:icon="@drawable/appicon" android:largeHeap="true" android:hardwareAccelerated="false">
<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="com.company.abcmobileapp.android.braintree" />
</intent-filter>
</activity>
</application>
<activity android:name="ShareActivity">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
</manifest>
Is there any suggestions as to what I can do to further debug or fix the issue? Any help is greatly appreciated, Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@kenny128,
No problem! I’m going to close this issue since it seems it’s working at least in some places, but I would recommend, if you haven’t already tried this, to destroy and recreate the emulator you’re using. Sometimes they can get into a bad state. Let me know if that works!
@kenny128,
I wasn’t able to reproduce this issue with a simple test app. Can you confirm the environment in which you’re testing is the only one experiencing this issue? i.e. is this occuring on a simulator on a specific version as opposed to a real device?