GLBasic forum

Main forum => GLBasic - en => Topic started by: Bluepixel on 2019-Nov-09

Title: How do i use Android Studio?
Post by: Bluepixel on 2019-Nov-09
Hi there, I was super excited to try out android studio, when I compiled to android it told me to install android studio so I did. I created a simple hello world program and when I compiled for android it started up android studio, started updating some stuff and after a long time of waiting I just got errors.

Ive tried a lot to make this work but nothing seems to work.
Is there maybe a tutorial or guide on how to use android studio?
Title: Re: How do i use Android Studio?
Post by: MrPlow on 2019-Nov-09
Check the readme in the android studio folder created by GLB after you compile.
Also the Android Studio SDK Manager needs to have SDKs and libraries installed - you can find more about those online...

There are certain things you need to change and others you need to leave as is.

build .gradle at the app level >

  // GLBASIC_USER_NOTE versionCode, versionNumber, target SDK
        minSdkVersion 23
        targetSdkVersion 29

androidmanifest.xml - make sure you have it setup correctly if you edited it.

Below image is my SDK tools setup.

Title: Re: How do i use Android Studio?
Post by: Qedo on 2020-May-04
Hi. I can't compile Android with last version Android Studio 3.6.3. Getting below error:
Do you have any advice on how to proceed?
Below image is my SDK tools setup.
Version Java java 1.6.0-25
Thank you

"ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve androidx.appcompat:appcompat:1.1.0.
Disable offline mode and sync project
Show Details
Affected Modules: app"

Title: Re: How do i use Android Studio?
Post by: dreamerman on 2020-May-04
I will join Your question. What beside Android Studio is currently needed to compile for Android - like specific JDK/Java version or some other tools (as for other tools that I checked recently they for example advised to use older Python versions and so on) are needed? Or I missing some tutorial that's available here on forum and it's up-to date..
Title: Re: How do i use Android Studio?
Post by: spacefractal on 2020-May-04
Java 1.6.0-25 and any other sun java is not required at all as Android Studio uses OpenSDK version of Java instead, which is included with Android Studio and installed by default. So you dont need to use any of the official java version at all!

Also if Android Studio want you to update project settings to newer settings in a project, then the project can cause fails to compile completly.

But if that was happens, its very easy to revert it again:

in File/Project Structure/Project

Make sure Android Grandle Plugin uses version 3.4.1 and Grandle version uses 5.1.1. We can uses a bit newer version here, but those versions should works and still works nicely today (has just released PowerUp Elevation today)!

Also im do heard androidx.appcompat:appcompat:1.1.0 is depreacted? howover line is still there and should not cause any trouble throught when that grandle versions above is using.

After that, open the grandle file again and sync. Then any missing sdk, cmake and ndk that is required should now been downloaded automatic. This take some time.

Title: Re: How do i use Android Studio?
Post by: MrPlow on 2020-May-04
Also, make sure to sync project before builds - and might need a clean project with the new update.