question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AndroidManifest exception with PayPal

See original GitHub issue

General 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.

image

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:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sdcoffeycommented, Feb 15, 2018

@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!

1reaction
sdcoffeycommented, Feb 13, 2018

@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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is wrong with my manifest and Braintree paypal exeption?
BraintreeException: BraintreeBrowserSwitchActivity missing, incorrectly configured in AndroidManifest.xml or another app defines the same ...
Read more >
Client-Side Implementation | Android - Braintree ... - PayPal Developer
This will determine which PayPal credentials are used for the transaction, and must match the merchant account specified with any other calls in...
Read more >
Integrating PayPal Payments In an Android Application
dependencies { compile 'com.paypal.sdk:paypal-android-sdk:2.14.3' }. Step2: We need to declare following payments upholding screens in AndroidManifest.xml.
Read more >
Google Groups
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.hello/com.paypal.android.sdk.payments.
Read more >
nativescript-paypal - npm
A NativeScript module providing access to PayPal SDK. ... activities and other data in your manifest file: ... "unhandled exception".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found