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

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

Closed
sodiqOladeni opened this issue Oct 30, 2019 · 15 comments · Fixed by #91
Assignees

Comments

@sodiqOladeni
Copy link

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
Copy link

mabside commented Nov 2, 2019

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
Copy link
Author

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

@c4software
Copy link

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
Copy link

bktowett commented Feb 28, 2020

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

@sodiqOladeni
Copy link
Author

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

@damolaobaleke
Copy link

Facing same problem as well

@damolaobaleke
Copy link

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
Copy link

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
Copy link
Member

michael-paystack commented Mar 4, 2020

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
Copy link

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

@Blakes-Mike
Copy link

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

@klazbaba
Copy link

klazbaba commented Oct 7, 2020

Still experiencing this issue though.

@DestinyAjax
Copy link

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

@klazbaba
Copy link

klazbaba commented Oct 8, 2020

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
Copy link

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.

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

Successfully merging a pull request may close this issue.

9 participants