PaystackHQ / paystack-android

Paystack SDK for Android. Accept payments on Android
Apache License 2.0
126 stars 102 forks source link

AAPT: error: resource attr/foreground (aka com.package.appname:attr/foreground) not found. #83

Closed sodiqOladeni closed 4 years ago

sodiqOladeni commented 5 years ago

Problem

Unable to compile App after adding Paystack dependecies

Proposed resolution

Unable to compile application after adding Paystack dependencies, i have also added the below code to my attrs file under values folder

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="ForegroundView">
        <attr name="foreground" format="color" />
        <attr name="foregroundGravity" format="integer" />
        <attr name="foregroundInsidePadding" format="boolean" />
    </declare-styleable>
</resources>

Repeatable

Always

Paystack version

implementation 'co.paystack.android.design.widget:pinpad:1.0.1'
implementation 'co.paystack.android:paystack:3.0.12'

App default configuration

defaultConfig {
        applicationId "com.eemanapp.fuoexaet"
        minSdkVersion 19
        targetSdkVersion 29
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

Actual Results:

/Users/mac/AndroidStudioProjects/AppName/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:4751: AAPT: error: resource attr/foreground (aka com.packageName.appName/foreground) not found.

mabside commented 5 years ago

Problem

Unable to compile App after adding Paystack dependecies

Proposed resolution

Unable to compile application after adding Paystack dependencies, i have also added the below code to my attrs file under values folder

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="ForegroundView">
        <attr name="foreground" format="color" />
        <attr name="foregroundGravity" format="integer" />
        <attr name="foregroundInsidePadding" format="boolean" />
    </declare-styleable>
</resources>

Repeatable

Always

Paystack version

implementation 'co.paystack.android.design.widget:pinpad:1.0.1'
implementation 'co.paystack.android:paystack:3.0.12'

App default configuration

defaultConfig {
        applicationId "com.eemanapp.fuoexaet"
        minSdkVersion 19
        targetSdkVersion 29
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

Actual Results:

/Users/mac/AndroidStudioProjects/AppName/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:4751: AAPT: error: resource attr/foreground (aka com.packageName.appName/foreground) not found.

Try changing your gradle plugin to stable version (3.5.1)

sodiqOladeni commented 5 years ago

I was using Android Studio 3.6 Beta, it worked well when I switched back to 3.5 Stable

c4software commented 4 years ago

Hi,

The stable version is now the 3.6.0, the problem is still present. Did you manage to found a way to resolve this issue ?

bktowett commented 4 years ago

Facing this same exact problem since this morning. Running on Android studio 3.6 and it's frustrating

sodiqOladeni commented 4 years ago

I think the codebase needs to be updated, try to run on old version 3.5

damolaobaleke commented 4 years ago

Facing same problem as well

damolaobaleke commented 4 years ago

I think the codebase needs to be updated, try to run on old version 3.5

Android studio 3.6 is now the stable version

c4software commented 4 years ago

The problem is with the latest gradle not really Android Studio, if you keep your previous gradle version it's will be ok with Android Studio 3.6

michael-paystack commented 4 years ago

Hi everyone, We've been taking a look at this. The issue here is with the Pinpad library this library depends on. We're working on a fix. Until that is completed, please use 3.5.x versions of the Android Gradle Plugin

damolaobaleke commented 4 years ago

Alright no problem then, would be expecting an update on the fix, Thanks@michael-paystack.

Blakes-Mike commented 4 years ago

Hi, i updated to 3.0.14 and still have the same issue

klazbaba commented 4 years ago

Still experiencing this issue though.

DestinyAjax commented 4 years ago

I'm faced with this same issue after I installed Paystack SDK for RN

klazbaba commented 4 years ago

I'm faced with this same issue after I installed Paystack SDK for RN

Do as @michael-paystack has mentioned up there. Decrease the Android Gradle Plugin to 3.5.x version. Do this in the project's build.gradle file. That solved it for me.

DestinyAjax commented 4 years ago

I'm faced with this same issue after I installed Paystack SDK for RN

Do as @michael-paystack has mentioned up there. Decrease the Android Gradle Plugin to 3.5.x version. Do this in the project's build.gradle file. That solved it for me.

Yea I tried that approach but it didn't work for me. But i have been able to resolve it as stated in this tread below:

https://stackoverflow.com/questions/56715285/how-to-fix-aapt-error-foreground-activity-not-found-when-running-ionic-cordova-b

And also I didn't want to downgrade my Gradle build version to avoid affecting other aspect of the project.