ccomeaux / boardgamegeek4android

BoardGameGeek application for Android (unofficial)
GNU General Public License v3.0
228 stars 47 forks source link

How to contribute (Android Studio) #120

Closed Kaligula0 closed 2 years ago

Kaligula0 commented 4 years ago

How to import the project to Android Studio? I tried downloading ZIP, cloning by Gitub Desktop and Cloning by Android Studio, but I think the problem is somewhere else, I don't know where. After opening I get the following error:

Screenshot

ERROR: CreateProcess error=2, Nie można odnaleźć określonego pliku <a href="openFile::C:\Users\Lenovo\StudioProjects\boardgamegeek4android\app\build.gradle">Open File</a> In English it will be cannot find the specified file or sth. But the file is there, I can find it in Windows Explorer, open and view in e.g. Notepad.

Here's Event Log:

2019-09-23
13:03   Load Settings
    Cannot load settings from file 'C:\Users\Lenovo\StudioProjects\boardgamegeek4android\app\app.iml': File C:\Users\Lenovo\StudioProjects\boardgamegeek4android\app\app.iml does not exist
    Please correct the file content
13:03   Gradle sync started with single-variant sync
13:03   Gradle sync failed: CreateProcess error=2, Nie można odnaleźć określonego pliku (2 s 74 ms)
13:03   NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN

I also downloaded google-services.json (as in CONTRIBUTING.md) but I don't know how to add this to project. In Android Studio the tree on the left looks different from how-tos in the internet, it's just a file list form the main folder while everybody shows that there should be an in-app resources tree view (or sth I don't know how to call it).

I'd love do help but I don't know how. I'm a hobby programmer but I've already helped with few websites and apps using various tools like github (since it was only CLI) or Eclipse – but I did it very very rarely so each time I'm very suprised by the changes. Please help me to help you.

Kaligula0 commented 4 years ago

Probably Android Studio Bug. I Googled for last line form Event log NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN and found this. Possibly Issue to close but I'm not sure until new Android Studio release.

ccomeaux commented 4 years ago

For comparison, I'm using Android Studio 3.5.1. You should add the google-services.json file in the app/ folder. I'm not using the NDK, so there might be a misconfiguration of Android Studio. Note that I have an app/app.iml file locally, but this is git ignored. See if adding the missing file will generate the IML file and get you past the error.

Kaligula0 commented 4 years ago

I completely uninstalled the Android Studio then.

Now I installed Android Studio 3.6.3. No more problems with NDK.

It still can't find file app/app.iml but I have a app/boardgamegeek4android-app.iml file – is it another thing or a substitute or another version of the same? Maybe your project directory is named app? Because mine is boardgamegeek4android (D:\GIT\boardgamegeek4android), maybe the filename is generated from the directory name.

I got also an error that it couldn't find git… I had to add it to my PATH variable. It's good to know if anybody else had the same issue.

And also I had to download Android SDK Platform 28 and Android SDK Build-Tools 28.0.3 → open Android SDK Manager via Menu/Tools/SDK Manager → tab SDK Platforms → choose Android 9.0 (Pie); and also tab SDK Tools → check Show Package Details below the list → choose Android SDK Build-Tools 28.0.3. (Download, install.) I wrote it JIC sb has the same issue.

Kaligula0 commented 4 years ago

But now I have the problem with com.github.rhlff:NestedScrollWebView:v1.0.2 described in https://github.com/ccomeaux/boardgamegeek4android/issues/134#issuecomment-617151304

Kaligula0 commented 2 years ago

All above problems are solved (also #134), thanks!

BUT – how can I build the apk to install it on my phone* and test it? Should it be signed or not? I tried unsigned and it didn't install at all, tried signing (firstly with Signare.jar from XDA) and it didn't install at all.

Can somebody show me the way, please @tupaschoal @icesphere @tvedeane ?

*) I can emulate it on my laptop, but Android Studio and VM together consume so much RAM that the virtual device is almost non-responsive. However, I tried, ran it succesfully, but couldn't sign in to my account.

gragatrim commented 2 years ago

Assuming you already got the google-services.json file and you're just looking how to build and sideload this this is what you nee to do(at least this is what I did). I use linux so I only have experience doing this from the command line and have no idea how to do it through android studio(I couldn't get anything to work through android-studio, the built in gradle kept dying on weird errors)

  1. After making your changes go back to the root of the project and use the gradlew(maybe for windows you need the gradle.bat file?) and run that with the assembleDebug option passed. 1.a ./gradlew assembleDebug 1.b I needed to chmod +x gradlew so that I could execute it
  2. Assuming that runs without issues(I changed the gradle.build file to ignore lint errors so that it would build for me) you'll find the apk in the following path in the repo app/build/outputs/apk/debug/app-debug-_.apk
  3. Sideloading is an easy as connecting your phone to your laptop(make sure to enable developer mode on your phone, and allow usb debbuging) and running adb install from the directory where your debug apk is.
  4. If you're still running the release versions from here it will complain that it's not signed correctly based on the version you have installed, so just delete the currently installed version, then run the command again.

Hopefully this helps, if not, feel free to ask for any more clarifications and I'll try to clarify.

ccomeaux commented 2 years ago

To answer @Kaligula0 's question from September, you can generate a Debug APK and install that on your phone. If you want is to upgrade the version of the app that I post here, you will need the signing key that I use. This is left over from the Google Play days.