stripe / stripe-terminal-android

Stripe Terminal Android SDK
https://stripe.dev/stripe-terminal-android/
Other
94 stars 46 forks source link

Tap to Pay #453

Closed thiagomacauba88 closed 7 months ago

thiagomacauba88 commented 7 months ago

Summary

Getting some issues when I'm trying to implement Tap to Pay. I followed the docs and removed: implementation "com.stripe:stripeterminal:2.16.0" added: implementation "com.stripe:stripeterminal-localmobile:2.21.1" implementation "com.stripe:stripeterminal-core:2.21.1"

I get the lowest version because I would like to change the minSDKVersion to 26, my current is 21

error: incompatible types: cannot be converted to int @androidx.room.Insert(onConflict = null)

This error above I managed to fix replacing: import androidx.room.OnConflictStrategy.REPLACE to import androidx.room.OnConflictStrategy.Companion.REPLACE

After this I got:

error: onCreate(SupportSQLiteDatabase) in <anonymous ironark.com.charge.data.database.room.AppDatabase_Impl$1> cannot override onCreate(SupportSQLiteDatabase) in Delegate protected void onCreate(SupportSQLiteDatabase _db) { ^ attempting to assign weaker access privileges; was public

Android version

ext { kotlin_version = '1.7.20' nav_version = '2.4.1' google_services_version = "4.3.13" hilt_version = "2.44" }

SDK version

apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' apply plugin: "androidx.navigation.safeargs" apply plugin: 'kotlin-kapt' apply plugin: 'dagger.hilt.android.plugin' apply plugin: "kotlinx-serialization" apply plugin: 'project-report'

android { packagingOptions { resources { excludes += ['META-INF/koin-core.kotlin_module'] } } compileSdkVersion 33 defaultConfig { applicationId "ironark.com.charge" minSdkVersion 21 targetSdkVersion 33 multiDexEnabled true } buildTypes { create("customDebugType") { debuggable = true } debug { manifestPlaceholders = [enableCrashReporting: "false"] } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' manifestPlaceholders = [enableCrashReporting: "true"] signingConfig signingConfigs.release } } buildToolsVersion = '33.0.0' compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = JavaVersion.VERSION_11 }

buildFeatures {
    viewBinding true
    dataBinding true
}
lint {
    checkDependencies true
}
namespace 'ironark.com.charge'

kotlinOptions {
    jvmTarget = "11"
}

}

dependencies {

def lifecycle_version = "2.5.1"
def arch_version = "2.1.0"
def nav_version = "2.5.3"
def fragment_version = "1.5.4"
def kotlin_coroutines = "1.6.4"
def room_version = "2.4.3"

implementation fileTree(include: ['*.jar'], dir: 'libs')

// UI
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation 'com.google.android.material:material:1.7.0'
implementation 'com.ernestoyaquello.dragdropswiperecyclerview:drag-drop-swipe-recyclerview:1.1.0'
implementation 'com.airbnb.android:lottie:5.0.3'
implementation "androidx.fragment:fragment-ktx:$fragment_version"
implementation "androidx.exifinterface:exifinterface:1.3.5"
implementation "androidx.media:media:1.6.0"
implementation 'androidx.webkit:webkit:1.5.0'

// API
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
implementation 'com.google.code.gson:gson:2.10'

// DATABASE
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
testImplementation "androidx.room:room-testing:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
//DataStore
implementation("androidx.datastore:datastore-preferences:1.0.0")

//SMOOCH Dependencies
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'

// RX and LIFECYCLE
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"

//KOTLIN
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
//COROUTINES
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines"

//JETPACK
//lifeCycleScope
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
// Saved state module for ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
// Annotation processor
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
// optional - helpers for implementing LifecycleOwner in a Service
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
// optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
// optional - ReactiveStreams support for LiveData
implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version"
// Navigation
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
// Navigation - Feature module Support
implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version"

//HILT
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"

//TESTING
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
//Test helpers for LiveData
testImplementation "androidx.arch.core:core-testing:$arch_version"
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"

//FIREBASE - CRASHLYTICS
implementation platform('com.google.firebase:firebase-bom:31.0.2')
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-perf'

//FIREBASE - PUSH NOTIFICATION
implementation 'com.google.firebase:firebase-messaging:23.1.0'

// UTILS
implementation 'org.jetbrains.anko:anko-commons:0.10.8'
implementation 'org.jetbrains.anko:anko-design:0.10.8'
implementation 'org.jetbrains.anko:anko:0.10.8'
implementation 'com.chibatching.kotpref:kotpref:2.9.2'
implementation 'com.chibatching.kotpref:initializer:2.9.2'
implementation 'com.stripe:stripe-android:20.15.3'
implementation 'io.card:android-sdk:5.5.1'
implementation 'com.simplify:partner-sdk-android:1.0.0@aar'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation "com.orhanobut:hawk:2.0.1"

// implementation "com.stripe:stripeterminal:2.16.0" implementation 'com.helpscout:beacon:3.0.2'

implementation "com.stripe:stripeterminal-localmobile:2.21.1"
implementation "com.stripe:stripeterminal-core:2.21.1"

//Play Core Library
implementation("com.google.android.play:core:1.10.3")
//Kotlin extensions library for Play Core
implementation("com.google.android.play:core-ktx:1.8.1")

//SUPPORT
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

}

chr-stripe commented 7 months ago

Hi @thiagomacauba88, given the error message you are describing above:

error: onCreate(SupportSQLiteDatabase) in <anonymous ironark.com.charge.data.database.room.AppDatabase_Impl$1> cannot override onCreate(SupportSQLiteDatabase) in Delegate protected void onCreate(SupportSQLiteDatabase _db) { ^ attempting to assign weaker access privileges; was public

This looks like an application issue in how you are using Room, and does not look related to your usage of the Stripe Terminal SDK.

dmatthews-stripe commented 7 months ago

@thiagomacauba88 we are going to close this issue out, if you are still seeing issues, please contact support.