language-transfer / lt-app

React Native application for Language Transfer
https://www.languagetransfer.org/
Other
291 stars 26 forks source link

Issue Setting up Android Development Environment #39

Open dashedstripes opened 3 years ago

dashedstripes commented 3 years ago

Hey, first of all, full disclosure I am not an android dev, so apologies if I'm missing something basic!

I followed along the docs to setup the android development environment here: https://reactnative.dev/docs/environment-setup which had me installing Android SDK 29.0.2.

So far so good...

When attempting to run the project on android via npx react-native run-android I received the error:

image

After looking closer into the node_modules that get installed alongside this app, it seems like quite a few are running on Android SDK 28.0.3.

async-storage
masked-view
react-native-navigation-bar-color
react-native-reanimated
react-native-screens
@react-native-community
Screenshot 2021-05-30 at 11 12 51

It looks like these modules might be causing the build error, but as I'm not an android dev (and don't want to waste my Sunday afternoon lol) I thought I'd raise this in case I'm missing something obviously about setting up the android dev environment.

I guess my real question is, should I be downgrading my Android SDK to version 28.0.3, or is it worth trying to upgrade those modules to 29.0.2 to be consistent with the latest react-native docs?

SyntaxBlitz commented 3 years ago

I'm not much of an Android dev either, haha. But we can probably figure this one out.

It looks like the main build.gradle was actually updated to compile against SDK version 29 when I merged in commits from #27. I'm not sure why my dev environment works; my guess is that the dependencies compile against SDK 28, and the main app against SDK 29, and that just doesn't cause a problem.

Since the app should be compiling against version 29 now, it's probably save to upgrade dependencies (though preferably without changing the major version number). I think one of my next steps with this app will be to set up automated tests so I don't feel so nervous making changes, but right now there's nothing in place. So your best bet is to just look around after upgrading and see if stuff still seems like it works. If not, indeed installing SDK 28 alongside SDK 29 will probably fix your problem.