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

Android Release build issue #9

Closed
aolowude opened this issue Mar 19, 2018 · 10 comments
Closed

Android Release build issue #9

aolowude opened this issue Mar 19, 2018 · 10 comments

Comments

@aolowude
Copy link

So I have debugged and pinpointed that in Release Mode, react native apps don't compile in release mode, they only work in debug mode.

I tested by removing all the Paystack code and uninstalling and it compiles fine into release mode, but when compiling to release, I had to

  1. Add 'android.enableAapt2=false'
  2. It then gives the error 'Error:In ForegroundView, unable to find attribute foreground' and we are unable to get past that point.

Please assist.

@aolowude
Copy link
Author

Specifically, What went wrong:
ERROR: In ForegroundView, unable to find attribute foreground
ERROR: In ForegroundView, unable to find attribute foregroundGravity
...
Execution failed for task ':app:processReleaseResources'

@tolu360
Copy link
Owner

tolu360 commented Mar 19, 2018

Grab a shot of your terminal with the full error message and paste that here please. Would need to ascertain it's something for me to help with or something strictly for the guys at Paystack!

@aolowude
Copy link
Author

Without the line:
android.enableAapt2=false

I get the below:

noaapt2_1

![noaapt2_2](https://user-images.githubusercontent.com/1243485/37599050-1acad0d8-2b84-11e8-9eff-731b5ef350c4.png)

And when I set android.enableAapt2=false
I get the below:

aapt2false_2
aapt2false_1

@onewisepixel
Copy link

+1

@tolu360
Copy link
Owner

tolu360 commented Mar 19, 2018

The task app:processReleaseResources failing has little or nothing to do with this package. Do you have the loginbtn.png file in your Js bundle? It seems to get missing when you try to make a release build.

Try to recompile doing the following:

  • Leave aapt2 in its default value.
  • Exit any running instance of the Package manager/Metro Bundler on your terminal.
  • Run cd android && ./gradlew clean.
  • Then try your release build again.

@aolowude
Copy link
Author

I have indeed tried each of your recommendations and confirmed that the loginbtn.png is indeed there.
I have set aapt2 to true, false and removed it (which was default).

Note, when I removed the react-native-paystack package and then set aapt2 to false, it was able to Successfully compile without any other changes, which is what led me to the conclusion that it was indeed something with the package that was causing the issues.

@tolu360
Copy link
Owner

tolu360 commented Mar 19, 2018

So I can't reproduce your issue and hence may not be able to help further. It looks simple enough though, as it's just a case of RN asset compilation in release mode.

You can try setting up a new RN project, sample App.js code is just fine to test (don't add your app logic or asset). Add the package, do the linking and just try to make a release mode and see if you can reproduce the issue on this separate build.

@aolowude
Copy link
Author

Hi,

So yea I just ended up recreating my package and it works fine, I was able to do a live payment with OTP and Pin.

Many thanks for your work and effort amigo

@dansmog
Copy link

dansmog commented Jun 15, 2018

@aolowude What did you do last?

@Dwayne01
Copy link

how was this issue resolved @aolowude

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

No branches or pull requests

5 participants