Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML Attribute parsing failed exception thrown by SDK when trying to create a transaction #82

Open
rockers007 opened this issue Jul 26, 2021 · 1 comment

Comments

@rockers007
Copy link

rockers007 commented Jul 26, 2021

I am trying to use this SDK to integrate bbpos Chipper 2x BT in my flutter app.
Everything listed below works fine:

  • Detecting the POS device
  • Connecting to the device
  • Setting up UI configuration/Customisations for Inperson SDK

But when I try to create a transcation for purchase, I am getting following error:

[   +7 ms] W/ActivityThread(29725): handleWindowVisibility: no activity for token android.os.BinderProxy@a40532e
[ +292 ms] I/tslogin.androi(29725): Compiler allocated 4127KB to compile int com.bbpos.emvswipe.ɩ.ॱˎ()
[  +11 ms] D/AndroidRuntime(29725): Shutting down VM
[   +5 ms] E/AndroidRuntime(29725): FATAL EXCEPTION: main
[        ] E/AndroidRuntime(29725): Process: com.schooleventticketslogin.android, PID: 29725
[        ] E/AndroidRuntime(29725): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.schooleventticketslogin.android/net.authorize.aim.emv.EMVActivity}: android.view.InflateException: Binary XML file line #7 in com.schooleventticketslogin.android:layout/emvlayout: Failed to resolve attribute at index 1: TypedValue{t=0x2/d=0x7f030003 a=-1}
[        ] E/AndroidRuntime(29725): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3271)
[        ] E/AndroidRuntime(29725): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
[        ] E/AndroidRuntime(29725): 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
[        ] E/AndroidRuntime(29725): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
[        ] E/AndroidRuntime(29725): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
[        ] E/AndroidRuntime(29725): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
[        ] E/AndroidRuntime(29725): 	at android.os.Handler.dispatchMessage(Handler.java:107)
[        ] E/AndroidRuntime(29725): 	at android.os.Looper.loop(Looper.java:214)
[        ] E/AndroidRuntime(29725): 	at android.app.ActivityThread.main(ActivityThread.java:7397)
[        ] E/AndroidRuntime(29725): 	at java.lang.reflect.Method.invoke(Native Method)
[        ] E/AndroidRuntime(29725): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
[        ] E/AndroidRuntime(29725): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
[        ] E/AndroidRuntime(29725): Caused by: android.view.InflateException: Binary XML file line #7 in com.schooleventticketslogin.android:layout/emvlayout: Failed to resolve attribute at index 1: TypedValue{t=0x2/d=0x7f030003 a=-1}
[        ] E/AndroidRuntime(29725): Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 1: TypedValue{t=0x2/d=0x7f030003 a=-1}
[        ] E/AndroidRuntime(29725): 	at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:825)
[        ] E/AndroidRuntime(29725): 	at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:7977)
[        ] E/AndroidRuntime(29725): 	at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:8174)
[        ] E/AndroidRuntime(29725): 	at android.widget.LinearLayout$LayoutParams.<init>(LinearLayout.java:2023)
[        ] E/AndroidRuntime(29725): 	at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1917)
[        ] E/AndroidRuntime(29725): 	at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:89)
[        ] E/AndroidRuntime(29725): 	at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1258)
[        ] E/AndroidRuntime(29725): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:1119)
[        ] E/AndroidRuntime(29725): 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
[        ] E/AndroidRuntime(29725): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
[        ] E/AndroidRuntime(29725): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
[        ] E/AndroidRuntime(29725): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
[        ] E/AndroidRuntime(29725): 	at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:438)
[        ] E/AndroidRuntime(29725): 	at android.app.Activity.setContentView(Activity.java:3347)
[        ] E/AndroidRuntime(29725): 	at androidx.activity.ComponentActivity.setContentView(ComponentActivity.java:380)
[        ] E/AndroidRuntime(29725): 	at net.authorize.aim.emv.EMVActivity.onCreate(:122)
[        ] E/AndroidRuntime(29725): 	at android.app.Activity.performCreate(Activity.java:7841)
[        ] E/AndroidRuntime(29725): 	at android.app.Activity.performCreate(Activity.java:7830)
[        ] E/AndroidRuntime(29725): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
[        ] E/AndroidRuntime(29725): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3246)
[        ] E/AndroidRuntime(29725): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
[        ] E/AndroidRuntime(29725): 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
[        ] E/AndroidRuntime(29725): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
[        ] E/AndroidRuntime(29725): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
[        ] E/AndroidRuntime(29725): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
[        ] E/AndroidRuntime(29725): 	at android.os.Handler.dispatchMessage(Handler.java:107)
[        ] E/AndroidRuntime(29725): 	at android.os.Looper.loop(Looper.java:214)
[        ] E/AndroidRuntime(29725): 	at android.app.ActivityThread.main(ActivityThread.java:7397)
[        ] E/AndroidRuntime(29725): 	at java.lang.reflect.Method.invoke(Native Method)
[        ] E/AndroidRuntime(29725): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
[        ] E/AndroidRuntime(29725): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
[  +36 ms] I/Process (29725): Sending signal. PID: 29725 SIG: 9
[ +122 ms] Service protocol connection closed.
[        ] Lost connection to device.

Line causing the crash:

<include layout="@layout/toolbarsdk"></include> 

Content of file causing the crash (emvlayout.xml from sdk's aar file):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    >
    <include layout="@layout/toolbarsdk"></include>
    <TextView
        android:id="@+id/modelTextView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:visibility="gone" />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="3"
        android:layout_gravity="center_horizontal"
        android:padding="30dp"
        android:orientation="vertical"
        android:id="@+id/layout_emv_sdk_container">

        <TextView
            android:id="@+id/textViewEMVLabel"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text="Transaction Amount"
            android:textSize="25sp" />

        <TextView
            android:id="@+id/amountTextView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text=""
            android:textAlignment="center"
            android:textSize="35sp"
            android:textStyle="bold" />

        <EditText
            android:id="@+id/amountEditText"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginLeft="5dip"
            android:layout_marginRight="5dip"
            android:editable="false"
            android:gravity="center"
            android:visibility="gone"
            android:hint="Transaction amount"/>

        <EditText
            android:id="@+id/statusEditText"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginLeft="5dip"
            android:layout_marginRight="5dip"
            android:layout_weight="1"
            android:editable="false"
            android:gravity="center"
            android:text="Please wait"
            android:textSize="22sp"
            android:hint="Transaction status"/>

        <Button
            android:id="@+id/cancelButton"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Cancel Transaction"
            style="@style/button_material"
            android:textColor="@color/white" />
    </LinearLayout>

</LinearLayout>

I'd appreciate a quick response to this.

@rockers007 rockers007 changed the title Binary XML file line #7 in com.schooleventticketslogin.android:layout/emvlayout: Failed to resolve attribute at index 1: TypedValue{t=0x2/d=0x7f030003 a=-1} XML Attribute parsing failed exception thrown by SDK when trying to create a transaction Jul 26, 2021
@hemant-sudhanshu
Copy link

I am also getting the same error and struggling for a week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants