tolu360 / react-native-paystack

React Native Wrapper for the Paystack Native Mobile SDKs
162 stars 46 forks source link

AAPT: error: resource attr/foreground #50

Closed ckOfor closed 3 years ago

ckOfor commented 4 years ago

VERSION

WHAT DID I DO

ERROR MESSAGE


Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /Users/username/.gradle/caches/transforms-2/files-2.1/a87106e7088d5bdb8f21b169b6bd1e33/jetified-pinpad-1.0.1/res/values/values.xml:7:5-161: AAPT: error: resource attr/foreground (aka com.appname/foreground) not found.

     /Users/username/.gradle/caches/transforms-2/files-2.1/a87106e7088d5bdb8f21b169b6bd1e33/jetified-pinpad-1.0.1/res/values/values.xml:7:5-161: AAPT: error: resource attr/foregroundGravity (aka com.appName/foregroundGravity) not found.```
Onibenjo commented 3 years ago

i have this issue

Onibenjo commented 3 years ago

@tolu360

ckOfor commented 3 years ago

@Onibenjo please check here for the fix.

dammyson commented 3 years ago

Add

<declare-styleable name="ForegroundView">
    <attr name="foreground" format="color" />
    <attr name="foregroundGravity" format="integer" />
    <attr name="foregroundInsidePadding" format="boolean" />
</declare-styleable>

ass attribute in you to the android res/value in the library (node module)

neyosoft commented 3 years ago

Create an attrs.xml file in the values directory (/android/app/src/res/values/attr.xml)

<declare-styleable name="ForegroundView">
    <attr name="foreground" format="color" />
    <attr name="foregroundGravity" format="integer" />
    <attr name="foregroundInsidePadding" format="boolean" />
</declare-styleable>
okechukwu0127 commented 2 years ago

I have this same issue. It suddenly started from no were this month. the /android/app/src/res/values/attr.xml file already existing and i even added a new attrs.xml file seeing your post and after building, i get the same error.

All the error points to - com.arttitude360.reactnative.rnpaystack

Nothing seems to work for me.

How can this be fixed please ?

okechukwu0127 commented 2 years ago

Create an attrs.xml file in the values directory (/android/app/src/res/values/attr.xml)

<declare-styleable name="ForegroundView">
    <attr name="foreground" format="color" />
    <attr name="foregroundGravity" format="integer" />
    <attr name="foregroundInsidePadding" format="boolean" />
</declare-styleable>

Nothing seems to work for me even after following your directions.

What am i not doing right please ?

Solomon198 commented 2 years ago

@okechukwu0127 i had this same issue for some weeks and the following hack I did fixed it. 1) Go to your node_modules and look for react-native-paystack/android folder 2) Open the build.gradle file and change line 47 which contains widget for pinpad from 1.0.1 to 1.0.3 Seems the widget old version is having compatibility issues. the line looks like this .. change from ... implementation 'co.paystack.android.design.widget:pinpad:1.0.1' to implementation 'co.paystack.android.design.widget:pinpad:1.0.3'