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 problem with .env #655

Closed
danieldanielecki opened this issue May 9, 2022 · 6 comments
Closed

Android Release problem with .env #655

danieldanielecki opened this issue May 9, 2022 · 6 comments

Comments

@danieldanielecki
Copy link

danieldanielecki commented May 9, 2022

I went through the docs quite throughly:

Also, through many of the issues and its comments, such us:

and it still doesn't work on release by simply showing a white screen :( the app works fine on Android simulator, Android physical device with USB debugging (I can see Reading env from: .env), iOS simulator/physical device on localhost/release.
I do have a problem with obtaining Google Maps API Key from the .env in the @string/GOOGLE_MAPS_API/AndroidManifest.xml, which causes the white screen. I do build using expo build:android instead of eas build --platform android due to https://stackoverflow.com/questions/71909541/android-gradle-plugin-requires-java-11-to-run-you-are-currently-using-java-1-8

My commit with all the changes required for all those configs: tamotam-com/tamotam-app@49cb29a

Therefore, a question, is the package still working? Anyone was able to do so recently?
My versions of packages:

  • classpath('com.android.tools.build:gradle:7.1.1'
  • "react-native": "0.64.3"
  • "react-native-config": "^1.4.5"
@Mr0cket
Copy link

Mr0cket commented May 16, 2022

Yes, I just built with "react-native-config": "^1.4.5", the env file (.env.develop) was detected/read successfully.

First of all, you mention it shows a white screen when building release. How are you sure your root problem is due to this library?

If you can answer that with confidence, My suggestion would be to go back to your last good commit (the one before you added all these changes) and try to setup react-native-config there from scratch.

That way you can be sure none of these unrelated changes are causing any conflicts. Once you have a release build working, add the other changes, until it breaks.

@danieldanielecki
Copy link
Author

@Mr0cket thanks for your contribution, the problem was com.android.tools.build:gradle:7.1.1 instead of com.android.tools.build:gradle:4.1.0 in build.gradle, which I have updated while using Android Studio... wow!

@Mr0cket
Copy link

Mr0cket commented May 23, 2022

Oh yeah... that sounds like a tough change to debug. I believe the new gradle plugin v7.1.1 is only used from RN v0.67.

@danieldanielecki
Copy link
Author

It was... especially when building the first React Native app =)

@Irfanwani
Copy link

How to use it with eas build

@danieldanielecki
Copy link
Author

@Irfanwani, I've it working on my app, with eas build.
Feel free to review the code and implement it by yourself :) https://github.com/tamotam-com/tamotam-app

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

3 participants