I am attempting to get the code associated with the free open source Mushroom Observer mobile app working on my system so I can start fixing bugs. It's a React Native app and it was last built for Android using Gradle 6.9 on an Intel Mac. I'm trying to build it on an M1 Mac using the latest Android Studio. I've been trying the approach of upgrading Gradle (as seems to be required by Android Studio) and resolving issues as I encounter them, but I'm very new to both Android and react native development. After a couple of days of concerted effort, I'm not sure this is the right strategy. I have the app building successfully for iPhone, but had to downgrade Node to v16.20.2 which I think is not working well with my Android toolchain. I'm now debating whether it makes more sense to keep on the path I'm on, try to downgrade Android Studio to a version that is more compatible with Gradle 6.9, or working to upgrade Node and the rest of the React Native toolchain to something more current and then work on the Android side.
After doing more research on Gradle 6.9 I got further when I installed Java 11 (which I think Gradle 6.9 requires and doesn't come by default with Android Studio). My next issue is "Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.1." which is happening for several modules. I looked around for Google hints on that and I can't figure out why it thinks I'm using that version of Kotlin. The "Configure Kotlin..." panel claims it's using 2.0.0-Beta4 and the lowest version in the dropdown is 1.8.
Interestingly after resetting everything yet another time, I got back to that uploadArchives() issue and the fix pointed to in the comment below helped, but just to get me back to the Kotlin issue.
All help and suggestions are very welcome.
More context:
The repo is here: https://github.com/MushroomObserver/mushroom-observer-mobile. The app itself is here: https://play.google.com/store/apps/details?id=org.mushroomobserver.mobile&gl=us
The app was last successfully built in July of 2023 using Gradle 6.9 on an Intel Mac owned by a consultant who due to health reasons is no longer active in our community. I have been trying to get it working on an Apple M1 system (MacOS Sonoma 14.2) with Android Studio Hedgehog | 2023.1.1 (Build #AI-231.9392.1.2311.11076708, built on November 9, 2023). I've been documenting my trials here: https://github.com/MushroomObserver/mushroom-observer-mobile/issues/66.
Made it! I think the Kotlin issue was resolved by selecting the oldest major.minor version of Kotlin (1.8.22 at the moment) in Tools -> Kotlin -> Configure Kotlin in Project, updating react-native from 0.66.1 to 0.66.5 to fix "more than one file" error (see More than one file was found with OS independent path 'lib/armeabi-v7a/libfbjni.so'), and doing a totally clean build (deleting ~/.gradle is important, may as well do node_modules etc.). I then had to monkey some with getting the right emulator selected, but once that was done the app actually ran!
Leaving this record for posterity.