Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java BraintreBrowserSwitchActivity缺失,在AndroidManifest.xml或其他应用程序中配置不正确,定义了与此应用程序相同的浏览器开关url_Java_Android_Flutter_Braintree - Fatal编程技术网

Java BraintreBrowserSwitchActivity缺失,在AndroidManifest.xml或其他应用程序中配置不正确,定义了与此应用程序相同的浏览器开关url

Java BraintreBrowserSwitchActivity缺失,在AndroidManifest.xml或其他应用程序中配置不正确,定义了与此应用程序相同的浏览器开关url,java,android,flutter,braintree,Java,Android,Flutter,Braintree,我正在尝试在我的应用程序中实现Braintree Android SDK。当我尝试使用PayPal支付方式时,我遇到了一个奇怪的错误。Braintree的文档说明我必须在我的AndroidManifest中实现这一点: <activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity" android:launchMode="singleTask">

我正在尝试在我的应用程序中实现Braintree Android SDK。当我尝试使用PayPal支付方式时,我遇到了一个奇怪的错误。Braintree的文档说明我必须在我的AndroidManifest中实现这一点:

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

这是我在实现后的AndroidManifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.plugon.flutterbraintree_example">

    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="flutterbraintree_example"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- This keeps the window background of the activity showing
                 until Flutter renders its first frame. It can be removed if
                 there is no splash screen (such as the default splash screen
                 defined in @style/LaunchTheme). -->
            <meta-data
                android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
                android:value="true" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <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>
    </application>
</manifest>


因此,我的代码工作正常,所有内容都显示出来了,但当我选择Paypal进行支付时,我会出现以下错误:BraintreBrowserSwitchActivity丢失,在AndroidManifest.xml或其他应用程序中配置不正确,定义了与此应用程序相同的浏览器开关url。

你知道我做错了什么吗


谢谢

我已经通过重命名我的应用程序id解决了这个问题。显然,braintree SDK不喜欢在应用程序id中添加下划线。在我将应用程序id重命名为没有特殊字符的id后,它起到了作用。。。
我希望这会有所帮助。

确保您的应用程序ID没有任何特殊字符和大写字母。如果是,请删除特殊字符并将应用程序id更改为小写字母

删除包名称中的下划线

注意:您定义的方案必须使用所有小写字母。如果包中包含下划线,则在Android清单中指定方案时应删除下划线

请查看此以了解更多信息

实际上我也有同样的问题,但我无法解决……这就是我的问题所在。这节省了我的时间。非常感谢。