-
Notifications
You must be signed in to change notification settings - Fork 20
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
CardReadersActivity InflateException error #11
Comments
Hi, thanks for this report. Mostly likely it's because you are running on Android 4.0. Unfortunately this SDK is supposed to run on Android 5 or higher. We will update the docs and take a look to enforce minimal API level. |
Hey Fabricio,
I am trying to run it on Android 9 and Android 10
…On Tue, Nov 10, 2020 at 5:28 PM Fabricio Vergara ***@***.***> wrote:
Hi, thanks for this report.
Mostly likely it's because you are running on Android 4.0. Unfortunately
this SDK is supposed to run on Android 6 or higher.
Please, can you confirm if this happens on Android 6 or higher?
We will update the docs and take a look to enforce minimal API level.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALMH4WHZ22MKK7GN6GZ2I2TSPFLYVANCNFSM4TQOVBYA>
.
|
Any news? |
I didn't managed to reproduce, would be possible to provide a sample app with this specific case? |
Unfortunately I cannot send you our code. I will paste some important
snippets for you. Hope it helps
Manifest:
<application
android:name=".XXX"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/KioskTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:theme"
tools:targetApi="m">
<activity
android:name="com.izettle.android.auth.OAuthActivity"
android:launchMode="singleTask"
android:taskAffinity="@string/oauth_activity_task_affinity">
<intent-filter>
<data
android:host="izettle"
android:scheme="XXX" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Styles.xml:
<style name="KioskTheme"
parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
<item name="colorPrimaryDark">@color/actionBarBackgroundColour</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorControlNormal">@android:color/white</item>
<item name="android:homeAsUpIndicator">@drawable/ic_keyboard_arrow_left_black_24dp</item>
</style>
defaultConfig {
applicationId "com.xxxx.xxxxx"
minSdkVersion 21
targetSdkVersion 29
versionCode 29
versionName "1.0.2"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
|
Some more code (openCardReaderSettings) crashes:
class IZettlePayments( private val context: Context, private val
paymentRepository: PaymentRepository) {
fun startIZettlePayments() {
val redirectUrl = "$IZETTLE_REDIRECT_URL://$IZETTLE_HOST"
IZettleSDK.init(context, iZettleClientId, redirectUrl)
ProcessLifecycleOwner.get().lifecycle.addObserver(SdkLifecycle(IZettleSDK))
}
fun doLogin(activity: Activity) {
IZettleSDK.user.login(
activity,
ContextCompat.getColor(context, android.R.color.white)
)
}
fun openCardReaderSettings() {
val intent = CardReadersActivity.newIntent(context)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(context, intent, null)
}
private fun buildTransactionReference(orderDetails: WebOrder):
TransactionReference {
val internalTraceId = orderDetails.orderId?.toString() ?:
UUID.randomUUID().toString()
return TransactionReference.Builder(internalTraceId)
.put(
PAYMENT_EXTRA_INFO,
"Payment for bill no. ${orderDetails.orderId} in
${orderDetails.venue?.name}"
)
.build()
}
fun startPaymentForResult(activity: Activity, orderDetails: WebOrder) {
val intent = CardPaymentActivity.IntentBuilder(context)
.amount(orderDetails.total?.toLong() ?: throw
NullPointerException("Amount is not valid") )
.reference(buildTransactionReference(orderDetails))
.enableLogin(true)
.enableTipping(false)
.enableInstalments(true)
.build()
startActivityForResult(activity, intent,
IZETTLE_PAYMENT_REQUEST_CODE, null)
}
…On Mon, Nov 16, 2020 at 10:30 AM Jonas Simonaitis < ***@***.***> wrote:
Unfortunately I cannot send you our code. I will paste some important
snippets for you. Hope it helps
Manifest:
<application
android:name=".XXX"
android:allowBackup="true"
***@***.***/ic_launcher"
***@***.***/app_name"
***@***.***/ic_launcher_round"
android:supportsRtl="true"
***@***.***/KioskTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:theme"
tools:targetApi="m">
<activity
android:name="com.izettle.android.auth.OAuthActivity"
android:launchMode="singleTask"
***@***.***/oauth_activity_task_affinity">
<intent-filter>
<data
android:host="izettle"
android:scheme="XXX" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Styles.xml:
<style name="KioskTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
<item ***@***.***/actionBarBackgroundColour</item>
<item ***@***.***/colorAccent</item>
<item ***@***.***:color/white</item>
<item ***@***.***/ic_keyboard_arrow_left_black_24dp</item>
</style>
defaultConfig {
applicationId "com.xxxx.xxxxx"
minSdkVersion 21
targetSdkVersion 29
versionCode 29
versionName "1.0.2"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
|
I understand, my idea was to create a fork from the sample in this repo and make it happen. |
Hey @fabriciovergara, We have found that one of our AAR dependencies had Kind regards |
Good to know, thanks! |
Expected Behavior
Open CardReadersActivity
Current Behavior
CardReadersActivity crashes due to android.view.InflateException
Steps to Reproduce
startActivity(CardReadersActivity.newIntent(this))
Call CardReaderActivity
Context
Failure Logs
The text was updated successfully, but these errors were encountered: