payu-intrepos / Android-Custom-Browser

Custom Browser module for SDK
11 stars 9 forks source link

PreLollipopPaymentsActivity$1 line 98 com.payu.custombrowser.PreLollipopPaymentsActivity$1.onCustomTabsServiceConnected #12

Closed hemanth2k13 closed 5 years ago

hemanth2k13 commented 6 years ago

Fatal Exception: java.lang.NoSuchMethodError android.support.customtabs.CustomTabsIntent.launchUrl   |com.payu.custombrowser.PreLollipopPaymentsActivity$1.onCustomTabsServiceConnected (SourceFile:98)   |android.support.customtabs.CustomTabsServiceConnection.onServiceConnected (CustomTabsServiceConnection.java:32)   | android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1111)   | android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1128)   | android.os.Handler.handleCallback (Handler.java:730)   | android.os.Handler.dispatchMessage (Handler.java:92)   | android.os.Looper.loop (Looper.java:176)   | android.app.ActivityThread.main (ActivityThread.java:5493)   | java.lang.reflect.Method.invokeNative (Method.java)   | java.lang.reflect.Method.invoke (Method.java:525)   | com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1225)   | com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1041)   | dalvik.system.NativeStart.main (NativeStart.java)

I got this fabric crash in multiple devices running Android 4. Help required.

himgupta229 commented 6 years ago

Please share your compile sdk /gradle file

yogirana5557 commented 6 years ago

Getting same issue in app // PayUMoney dependencies implementation 'com.payu.india:payu-sdk:4.4.4' implementation 'com.payu.magicretry:magicretry:1.0.6' implementation 'com.payu.custombrowser:payu-custom-browser:7.2.2''

compileSdkVersion = 27 buildToolsVersion = "27.0.3"

himgupta229 commented 6 years ago

Please check with release https://github.com/payu-intrepos/Android-Custom-Browser/releases/tag/7.2.1_27 for target sdk 27 .Gradle library is not for target sdk 27

ashish-bahl commented 5 years ago

I also have the same issue and am using the sdkui: module from the PayUBiz sample app.

himgupta commented 5 years ago

@abahl817 Please use https://github.com/payu-intrepos/Android-Custom-Browser/releases/tag/7.2.1_27 in case your compile sdk is 27 or post your gradle file here.

ashish-bahl commented 5 years ago

My compile and target sdk is 28 and below is the build.gradle file: ` apply plugin: "com.android.library" android { compileSdkVersion 28 buildToolsVersion '28.0.3'

defaultConfig {
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 2
    versionName "2.0.1"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { compile fileTree(include: ['*.jar'], dir: 'libs')

compile 'com.payu.custombrowser:payu-custom-browser:7.2.2'
compile 'com.payu.india:payu-sdk:4.4.4'
compile 'com.payu.samsungpay:samsungpay:1.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'

} `

himgupta229 commented 5 years ago

//Don't use below gradle use aar from the link with implementation keyword. compile 'com.payu.custombrowser:payu-custom-browser:7.2.2'

Change like below: api 'com.payu.india:payu-sdk:4.4.4' implementation 'com.payu.samsungpay:samsungpay:1.0' Rest remains same..

ashish-bahl commented 5 years ago

I did as you suggested, imported the CustomBrowser-Release.aar file as a module and added as a module dependency. But now when I open the payment page on a Kitkat device, a blank white screen opens up and nothing happens next. Also, in this method @Override public void onCBErrorReceived(int code, String errormsg) the error message == CHROME_NOT_PRESENT and code == 103

himgupta229 commented 5 years ago

Please try updating/installing chrome on that device as payment on api level <=19 is possible on Chrome tabs only if no GMS provider changes are present else please make changes for GMS provider in your application before invoking Custom Browser to make payment via Web View. If you have handled the GMS provider settings as described in above link please set below flag to make payment in webview. custombrowserconfig.setGmsProviderUpdatedStatus(CustomBrowserConfig.TRUE);

anilkr1997 commented 2 years ago
    <activity xmlns:android="http://schemas.android.com/apk/res/android"
        android:name="com.payu.custombrowser.PreLollipopPaymentsActivity"
        android:exported="true">
        <intent-filter>
            <data android:scheme="com.fsn.nykaa.success"/>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
        </intent-filter>
        <intent-filter>
            <data android:scheme="com.fsn.nykaa.failure"/>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
        </intent-filter>
    </activity>

i solve problem using this i recomendate also use may be help you