Author Topic: Android Studio error in creating app.  (Read 772 times)

Offline D2O

  • Prof. Inline
  • *****
  • Posts: 1078
    • View Profile
    • http://www.deuteriumoxid.com
Hello, when creating an Android app,
I get the following errors displayed.
Does anyone know what that could be?

Thanks.

https://www.glbasic.com/forum/index.php?action=dlattach;topic=11538.0;attach=8378;image
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #1 on: 2022-May-07 »
Is this a new error - have you managed to create apk already before now?

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline D2O

  • Prof. Inline
  • *****
  • Posts: 1078
    • View Profile
    • http://www.deuteriumoxid.com
Re: Android Studio error in creating app.
« Reply #2 on: 2022-May-07 »
With Android Studio and with the GLB Steam version
not yet.
With the older version yes.
I reinstalled GLB and AS here.
But AS on the D: HDD.
The path to AS has been adjusted.
AS starts, Gradle starts, but then this error message comes up.

Does AS have to be adjusted, or does it need a special one
SDK/NDK?
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #3 on: 2022-May-12 »
I myself have this setup:

C:\Android\android-sdk

SDK 31.0.0
Android platform tools 29.0.6
SDK Tools 26.1.1

Says I dont have NDK installed - but not 100%
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #4 on: 2022-May-12 »
API 31
Android SDK platform 31
Android SDK platform 30

been a while - but i managed to create apk just now

Make sure you asset icons are present for the res> folder

Create using AS - new asset options...
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #5 on: 2022-May-13 »
also...
example of part of my app config...

android {
    compileSdkVersion 30
    defaultConfig {
        if (buildAsApplication) {
            // GLBASIC_USER_NOTE applicationId
            // Here, GLBasic will put your company and app name.
            // The string for the launcher icon is in
            // app/src/main/res/values/strings.xml
          //  applicationId "com.gazzappergames.centiplode.centipedeshooter"
            applicationId "com.gazzapper.pillarfight.shooter"
        }
        // GLBASIC_USER_NOTE versionCode, versionNumber, target SDK
        minSdkVersion 23
        targetSdkVersion 30

        // version to detect when installing. Must be incresed for each app-store build.
        versionCode 1

        // version as shown to the user
        versionName "1.01"

        externalNativeBuild {
            ndkBuild {
                arguments "APP_PLATFORM=android-23"
                abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
            }
        }
...
etc etc.


Remember to keep gradle 3.4.1
at least mine is still on 3.4.1
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline D2O

  • Prof. Inline
  • *****
  • Posts: 1078
    • View Profile
    • http://www.deuteriumoxid.com
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #7 on: 2022-May-13 »
My output window shows:

NDK Resolution Outcome: Project settings: Gradle model version=5.1.1, NDK version=21.0.6113669
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #8 on: 2022-May-13 »
try remove that androidx dependancy - i dont use it at all?
i have it commented out...
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #9 on: 2022-May-13 »
There are many things to check for app to build...

- androidmanifest - correct and format is correct
- sdk, ndk and gradle settings libraries etc.
- dependancies

when I have time i will try replicate your test...to see if i get errors too...
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #10 on: 2022-May-18 »
Hi, i also managed to create an Android aab bundle with minsdk 23 and targetsdk 30

Wouldn't work but found a solution...

to edit the SDLActivity code - comment out the return command like below and add return library;

Code: (glbasic) [Select]
protected String getMainSharedObject() {
        String library;
        String[] libraries = SDLActivity.mSingleton.getLibraries();
        if (libraries.length > 0) {
            library = "lib" + libraries[libraries.length - 1] + ".so";

        } else {
            library = "libmain.so";
        }
        return library;
        //return getContext().getApplicationInfo().nativeLibraryDir + "/" + library;

    }
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline D2O

  • Prof. Inline
  • *****
  • Posts: 1078
    • View Profile
    • http://www.deuteriumoxid.com
Re: Android Studio error in creating app.
« Reply #11 on: 2022-May-19 »
@MrPlow,

Thank you for your support.
Regarding the commented out code.
Where is it in?
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1810
    • View Profile
Re: Android Studio error in creating app.
« Reply #12 on: 2022-May-20 »
@MrPlow,

Thank you for your support.
Regarding the commented out code.
Where is it in?

SDLActivity.java file under org.libsdl.app folder under java folder

I also gave someone on this forum, my version of my working JNI folder - as they were having errors creating with the newer default app > jni folder files...

« Last Edit: 2022-May-20 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs