stripe / stripe-android

Stripe Android SDK
https://stripe.com/docs/mobile/android
MIT License
1.26k stars 640 forks source link

[BUG] AAPT error #5827

Closed yixi195 closed 1 year ago

yixi195 commented 1 year ago

Summary

Code to reproduce

Android version

Impacted devices

Installation method

Dependency Versions

kotlin: 1.4.10 stripe-android: 20.15.4 Android Gradle Plugin: 4.0.1 Gradle: 6.5

SDK classes

Video

Other information

/Users/supermac/.gradle/caches/transforms-2/files-2.1/ab30a712c3b5340b17f46406bf0504b7/jetified-payments-core-20.15.4/res/layout/address_widget.xml:6: AAPT: error: resource string/address_label_country (aka com.earncheese.app:string/address_label_country) not found.

jameswoo-stripe commented 1 year ago

@yixi195 can you please provide a little more information? How are you seeing this issue? Any code samples?

yixi195 commented 1 year ago

An error was reported during the compilation process, causing the compilation to fail. What do I think is the conflict

jameswoo-stripe commented 1 year ago

@yixi195 Can you share your build.gradle?

yixi195 commented 1 year ago

apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin' apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'androidx.navigation.safeargs.kotlin' //firebase apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics'

android { compileSdkVersion buildVersions.compileSdk buildToolsVersion buildVersions.buildTools ndkVersion buildVersions.ndk lintOptions { //如打包出现Failed to transform libs.jar to match attributes checkReleaseBuilds false } defaultConfig { applicationId "com.test.app" minSdkVersion buildVersions.minSdk targetSdkVersion buildVersions.targetSdk versionCode VERSION_CODE as int versionName VERSION_NAME

    javaCompileOptions {
        annotationProcessorOptions {
            arguments = [
                    "room.schemaLocation"  : "$projectDir/schemas".toString(),
                    "room.incremental"     : "true",
                    "room.expandProjection": "true",
                    AROUTER_MODULE_NAME    : project.getName(),
                    AROUTER_GENERATE_DOC   : "enable"]
        }
    }
}

signingConfigs {
    release {
        v2SigningEnabled true
        storeFile file("../key/test.jks")
        storePassword RELEASE_STORE_PASSWORD
        keyAlias RELEASE_KEY_ALIAS
        keyPassword RELEASE_KEY_PASSWORD
    }
}

buildTypes {
    debug {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
            // 还可以添加 'x86', 'x86_64', 'mips', 'mips64','armeabi', 'armeabi-v7a',
        }
        minifyEnabled false// 混淆
        zipAlignEnabled false // Zipalign优化
        shrinkResources false  // 移除无用的resource文件
        firebaseCrashlytics {
            mappingFileUploadEnabled false
        }
        ext.alwaysUpdateBuildId = false//阻止 Crashlytics 不断更新其构建 ID,优化日常开发的编译速度
        signingConfig signingConfigs.release
        // 测试环境服务器
        buildConfigField 'String', 'APP_FLYER_KEY', "${APP_FLYER_KEY}"
        buildConfigField 'String', 'DOSH_APPLICATION_ID', "${DEV_APPLICATION_ID}"
        buildConfigField 'String', 'SERVER_URL', "${BASE_API_HOST_DEV}"
        buildConfigField 'String', 'OAUTH_SERVER_URL', "${OAUTH_API_HOST_DEV}"
        buildConfigField 'String', 'SHARE_LINK', "${SHARE_LINK}"
        buildConfigField 'String', 'SHARE_POST_LINK', "${SHARE_POST_LINK}"
        buildConfigField 'String', 'ONESIGNAL_APP_ID', "${ONESIGNAL_APP_ID}"
        //Zendsk
        buildConfigField 'String', 'ZENDESK_APP_ID', "${ZENDESK_APP_ID}"
        buildConfigField 'String', 'ZENDESK_CLIENT_ID', "${ZENDESK_CLIENT_ID}"
        buildConfigField 'String', 'ZENDESK_ACCOUNT_KEY', "${ZENDESK_ACCOUNT_KEY}"
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
    release {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        }
        signingConfig signingConfigs.release
        minifyEnabled true // 混淆
        zipAlignEnabled true // Zipalign优化
        shrinkResources true  // 移除无用的resource文件
        firebaseCrashlytics {
            mappingFileUploadEnabled false
        }
        // 正式环境服务器
        buildConfigField 'String', 'APP_FLYER_KEY', "${APP_FLYER_KEY}"
        buildConfigField 'String', 'DOSH_APPLICATION_ID', "${PROD_APPLICATION_ID}"
        buildConfigField 'String', 'SERVER_URL', "${BASE_API_HOST_PROD}"
        buildConfigField 'String', 'OAUTH_SERVER_URL', "${OAUTH_API_HOST_PROD}"
        buildConfigField 'String', 'SHARE_LINK', "${SHARE_LINK}"
        buildConfigField 'String', 'SHARE_POST_LINK', "${SHARE_POST_LINK}"
        buildConfigField 'String', 'ONESIGNAL_APP_ID', "${ONESIGNAL_APP_ID}"
        //Zendsk
        buildConfigField 'String', 'ZENDESK_APP_ID', "${ZENDESK_APP_ID}"
        buildConfigField 'String', 'ZENDESK_CLIENT_ID', "${ZENDESK_CLIENT_ID}"
        buildConfigField 'String', 'ZENDESK_ACCOUNT_KEY', "${ZENDESK_ACCOUNT_KEY}"
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

    }
    local {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
            // 还可以添加 'x86', 'x86_64', 'mips', 'mips64','armeabi', 'armeabi-v7a',
        }
        minifyEnabled true // 混淆
        zipAlignEnabled true // Zipalign优化
        shrinkResources true  // 移除无用的resource文件
        signingConfig signingConfigs.release
        firebaseCrashlytics {
            mappingFileUploadEnabled false
        }
        // 测试环境服务器
        buildConfigField 'String', 'APP_FLYER_KEY', "${APP_FLYER_KEY}"
        buildConfigField 'String', 'DOSH_APPLICATION_ID', "${DEV_APPLICATION_ID}"
        buildConfigField 'String', 'SERVER_URL', "${BASE_API_HOST_LOCAL}"
        buildConfigField 'String', 'OAUTH_SERVER_URL', "${OAUTH_API_HOST_LOCAL}"
        buildConfigField 'String', 'SHARE_LINK', "${SHARE_LINK}"
        buildConfigField 'String', 'SHARE_POST_LINK', "${SHARE_POST_LINK}"
        buildConfigField 'String', 'ONESIGNAL_APP_ID', "${ONESIGNAL_APP_ID}"
        //Zendsk
        buildConfigField 'String', 'ZENDESK_APP_ID', "${ZENDESK_APP_ID}"
        buildConfigField 'String', 'ZENDESK_CLIENT_ID', "${ZENDESK_CLIENT_ID}"
        buildConfigField 'String', 'ZENDESK_ACCOUNT_KEY', "${ZENDESK_ACCOUNT_KEY}"
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }

    devprod {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
            // 还可以添加 'x86', 'x86_64', 'mips', 'mips64','armeabi', 'armeabi-v7a',
        }
        minifyEnabled false// 混淆
        zipAlignEnabled false // Zipalign优化
        shrinkResources false  // 移除无用的resource文件
        debuggable true
        firebaseCrashlytics {
            mappingFileUploadEnabled false
        }
        signingConfig signingConfigs.release
        // 测试环境服务器
        buildConfigField 'String', 'APP_FLYER_KEY', "${APP_FLYER_KEY}"
        buildConfigField 'String', 'DOSH_APPLICATION_ID', "${PROD_APPLICATION_ID}"
        buildConfigField 'String', 'SERVER_URL', "${BASE_API_HOST_PROD}"
        buildConfigField 'String', 'OAUTH_SERVER_URL', "${OAUTH_API_HOST_PROD}"
        buildConfigField 'String', 'SHARE_LINK', "${SHARE_LINK}"
        buildConfigField 'String', 'SHARE_POST_LINK', "${SHARE_POST_LINK}"
        buildConfigField 'String', 'ONESIGNAL_APP_ID', "${ONESIGNAL_APP_ID}"
        //Zendsk
        buildConfigField 'String', 'ZENDESK_APP_ID', "${ZENDESK_APP_ID}"
        buildConfigField 'String', 'ZENDESK_CLIENT_ID', "${ZENDESK_CLIENT_ID}"
        buildConfigField 'String', 'ZENDESK_ACCOUNT_KEY', "${ZENDESK_ACCOUNT_KEY}"
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

buildFeatures {
    dataBinding = true
    viewBinding true
}
compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = "1.8"
}
dexOptions {
    javaMaxHeapSize "8g"
}
androidExtensions {
    experimental = true
}

}

repositories { flatDir { dirs 'libs' } mavenCentral() }

dependencies { implementation deps.androidx.annotation implementation deps.androidx.lifecycleLivedata implementation deps.androidx.lifecycleViewmodel implementation deps.material implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'com.google.android.material:material:1.2.1' implementation 'com.google.android.play:core-ktx:1.8.1' implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.0' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0' implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0' implementation 'androidx.navigation:navigation-ui-ktx:2.5.0' implementation 'androidx.annotation:annotation:1.2.0' testImplementation 'junit:junit:4.13.1' androidTestImplementation deps.androidx.junit androidTestImplementation deps.androidx.espresso implementation project(':ShareComponent') implementation project(':BaseComponent') implementation project(':SnackBarComponent')

implementation deps.kotlin
implementation deps.androidx.legacy
implementation deps.androidx.appcompat
implementation deps.androidx.constraintlayout
implementation deps.androidx.roomRuntime
kapt deps.androidx.roomCompiler
// optional - Kotlin Extensions and Coroutines support for Room
implementation deps.androidx.roomktx

//LiveEventBus
implementation deps.liveEventBus

//添加 Sensors Analytics SDK 依赖

// implementation deps.tools.SensorsAnalyticsSDK //firebase implementation deps.tools.firebaseanalytics implementation deps.tools.firebasecrashlytics implementation deps.widgetCore implementation platform('com.google.firebase:firebase-bom:27.0.0') implementation 'com.google.firebase:firebase-messaging-ktx'

kapt deps.glide.compiler
kapt "com.alibaba:arouter-compiler:1.2.2"
implementation "org.permissionsdispatcher:permissionsdispatcher:4.8.0"
kapt "org.permissionsdispatcher:permissionsdispatcher-processor:4.8.0"
implementation 'androidx.biometric:biometric:1.2.0-alpha01'
implementation 'com.afollestad.material-dialogs:color:3.3.0'
//基础工具库
implementation 'com.github.tamsiree.RxTool:RxKit:2.6.2'
implementation "com.squareup.okhttp3:logging-interceptor:4.9.0"
implementation "androidx.work:work-runtime-ktx:2.7.1"
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3'      //核心必须依赖
implementation 'com.scwang.smart:refresh-header-classics:2.0.3'    //经典刷新头

// implementation 'com.google.android.gms:play-services-maps:18.0.2' implementation 'org.greenrobot:eventbus:3.2.0' implementation "com.plaid.link:sdk-core:3.7.0"

implementation 'com.just.agentweb:agentweb-androidx:4.1.4' // (必选)
implementation 'com.github.Justson:CoolIndicator:v1.0.0'

// implementation('com.dosh:poweredby:2.5.0') { // exclude group: 'com.google.guava', module: 'listenablefuture' // }

implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.linkedin.dexmaker:dexmaker:2.25.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.onesignal:OneSignal:4.8.1'
implementation 'io.branch.sdk.android:library:5.0.4'
implementation 'com.google.firebase:firebase-appindexing:19.0.0'

// implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' implementation 'androidx.browser:browser:1.0.0' implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0' // implementation 'com.appsflyer:af-android-sdk:6.2.0@aar' implementation 'com.android.installreferrer:installreferrer:2.2' implementation 'androidx.print:print:1.0.0' implementation files('libs/itextpdf-5.5.8.jar') //faceBookSDk集成 // implementation 'com.facebook.android:facebook-android-sdk:[8,9)' //zendesk chat // implementation group: 'com.zendesk', name: 'chat', version: '3.3.0' // implementation group: 'com.zendesk', name: 'messaging', version: '5.2.0' //google pay // implementation(name:'play-services-tapandpay-17.1.2', ext:'aar') //over scroll implementation 'io.github.everythingme:overscroll-decor-android:1.1.1' //load sir implementation 'com.kingja.loadsir:loadsir:1.3.8' //引导蒙层 implementation 'com.github.huburt-Hu:NewbieGuide:v2.4.4' //finicity连接 implementation 'com.finicity.connect:connect-sdk:+' //预加载骨架屏 implementation 'com.ethanhua:skeleton:1.1.2' implementation 'io.supercharge:shimmerlayout:2.1.0' //图表 implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' // Stripe Android SDK implementation 'com.stripe:stripe-android:20.16.0' }

yixi195 commented 1 year ago

@jameswoo-stripe

jameswoo-stripe commented 1 year ago

@yixi195 the error you gave me shows 20.15.4, but you are using 20.16.0:

/Users/supermac/.gradle/caches/transforms-2/files-2.1/ab30a712c3b5340b17f46406bf0504b7/jetified-payments-core-20.15.4/res/layout/address_widget.xml:6: AAPT: error: resource string/address_label_country (aka com.earncheese.app:string/address_label_country) not found.

Have you tried clearing your cache? Manually delete your gradle cache, invalidate Android cache and restart, and then report back here.

jameswoo-stripe commented 1 year ago

Hi @yixi195, I hope your issue is resolved. If you are still having problems, please reopen this issue.