DanS2D / Solar2DTux

The Solar2D games/apps engine for Linux. Discord: https://discord.gg/WMtCemc
MIT License
46 stars 6 forks source link

Android builds no longer work. #5

Closed carlHR closed 3 years ago

carlHR commented 4 years ago

Hello, I'm using Solar2DTux (Linux version)

I tried posting this error in: https://solar2dtux.com/index.php/contact-us/ but it didn't worked. The message was not sent.

So, my problem is: when I try to build for Android, the build fails on exit code (256).

Simulator Terminal Log:

Platform: Linux / x64 / 1.0 / GeForce 920M/PCIe/SSE2 / 4.6.0 NVIDIA 390.138 / 1.0.0 / pt_br | br | pt_br | pt
Linux Plugin Manager: gathering plugins
Platform: Linux / x64 / 1.0 / GeForce 920M/PCIe/SSE2 / 4.6.0 NVIDIA 390.138 / 1.0.0 / pt_br | br | pt_br | pt
Loading project from: /home/carlos/Documents/Solar2D Projects/Testing Android App
Project sandbox folder: ~/.Solar2D/Sandbox/_d41d8cd98f00b204e9800998ecf8427e
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore /opt/Solar2D/Resources/debug.keystore -destkeystore /opt/Solar2D/Resources/debug.keystore -deststoretype pkcs12".
WARNING: Using custom daily build from user preferences: false - 68934a3e9455fa72420237eb05902327 (userPreferenceCustomDailyBuild)Starting Android build...
Using custom Build Id 68934a3e9455fa72420237eb05902327
Archive:  /opt/Solar2D/Resources/template_android.zip
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/sdk/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/sdk/licenses/
 extracting: /tmp/CoronaLabs/CLtmpNjdZIh/sdk/licenses/mips-android-sysimage-license  
 extracting: /tmp/CoronaLabs/CLtmpNjdZIh/sdk/licenses/android-sdk-license  
 extracting: /tmp/CoronaLabs/CLtmpNjdZIh/sdk/licenses/google-gdk-license  
 extracting: /tmp/CoronaLabs/CLtmpNjdZIh/sdk/licenses/android-googletv-license  
 extracting: /tmp/CoronaLabs/CLtmpNjdZIh/sdk/licenses/android-sdk-preview-license  
 extracting: /tmp/CoronaLabs/CLtmpNjdZIh/sdk/licenses/android-sdk-arm-dbt-license  
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/gradlew  
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/proguard-rules.pro  
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/build/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/build/tmp/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/build/generated/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/build/intermediates/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/build/outputs/
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/build.gradle.kts  
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/java/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/java/com/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/java/com/mycompany/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/java/com/mycompany/app/
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/java/com/mycompany/app/CoronaApplication.java  
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/res/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/res/values/
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/res/values/strings.xml  
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/src/main/AndroidManifest.xml  
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/_corona_splash_screen.png  
 extracting: /tmp/CoronaLabs/CLtmpNjdZIh/template/settings.gradle  
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/gradle/
   creating: /tmp/CoronaLabs/CLtmpNjdZIh/template/gradle/wrapper/
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/gradle/wrapper/gradle-wrapper.jar  
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/gradle/wrapper/gradle-wrapper.properties  
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/build.gradle.kts  
 extracting: /tmp/CoronaLabs/CLtmpNjdZIh/template/gradle.properties  
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/local.properties  
  inflating: /tmp/CoronaLabs/CLtmpNjdZIh/template/app/local.properties  
Excluding specified files from build: 
   excluding: LaunchScreen.storyboardc
   excluding: Icon.png
   excluding: Icon-*dpi.png
   excluding: Images.xcassets

BUILD SUCCESSFUL
Total time: 0 seconds
/home/carlos/.local/share/Corona/Native/Corona/lin/bin/lua: cannot open /tmp/CoronaLabs/CLtmpNjdZIh/template/app/build/intermediates/corona-build-tools/template/app/buildTools/convert_metadata.lua: No such file or directory

FAILURE: Build failed with an exception.

* Where:
Build file '/tmp/CoronaLabs/CLtmpNjdZIh/template/app/build.gradle.kts' line: 615

* What went wrong:
Process 'command '/home/carlos/.local/share/Corona/Native/Corona/lin/bin/lua'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Android build failed (256) after 7 secondsAndroid build failed. Check the log for more details.

build.settings:

--
-- For more information on build.settings, see the Project Build Settings guide at:
-- https://docs.coronalabs.com/guide/distribution/buildSettings
--

settings =
{
    orientation =
    {
        -- Supported values for orientation:
        -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
        default = "landscapeRight",
        supported = { "landscapeRight", },
    },

    --
    -- Android section
    --
    android =
    {
        usesPermissions =
        {
            "android.permission.INTERNET",
        },
    },

    --
    -- iOS section
    --
    iphone =
    {
        xcassets = "Images.xcassets",
        plist =
        {
            UIStatusBarHidden = false,
            UILaunchStoryboardName = "LaunchScreen",
        },
    },

    --
    -- Plugins section
    --
    plugins =
    {

    },

    --
    -- Project section
    --
    excludeFiles =
    {
        -- Exclude unnecessary files for each platform
        all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", },
        android = { "LaunchScreen.storyboardc", },
    },
}

What other forum problems were related:

After a little research in the Solar2D forums, I saw that this exit code was related when you tried to build the android app with plugins requested in the build.settings file.

Even if I'm not requesting plugins, I have confirmed I'm using the latest version of Solar2DTux (1.0.0).

This thread proves it: https://forums.solar2d.com/t/solar2dtux-pre-release-build-testing-get-it-here-solar2d-simulator-on-linux/352200, this error should have been fixed in this version.

Also, I'm trying to build a blank project. So, there are no plugins requested and the main.lua file is completely blank.

My Settings:

I'm using Linux Ubuntu (18.04). I have installed:

I have installed Android API Levels: 29, 28, 27, 24 (requested by the Solar2DTux) and 16. (Did it using Android Studio.)

I tried to install Java8, and set it as the default java version. (Previous was java 11)

Building to Android with other software works:

I tried building to android using Unity Remote 5 (which uses ADB, NDK and Gradlew to connect to an Android device and build the app in realtime). It required a bit of struggle to connect the device, but it works fine.

So in theory, these apps should be working. What is wrong here must be something else with the simulator's building code.

Thanks, Carlos HR.

DanS2D commented 4 years ago

Thanks for the report. Something changed within Android studio (and/or its build tools) which has been the cause of this issue. I am completely re-doing how Android builds are handled by Solar2DTux, so this issue will be resolved when that is complete.

I don't have an ETA for you, but it is my main focus right now. I'll update you here when this is resolved.

Thank you

carlHR commented 4 years ago

I forgot to say that I have installed multiple versions of Android sdk. Is there a way to link the right SDK, NDK versions to use?

(I ask this bc Unity Remote 5 lets you set this in its settings)

DanS2D commented 4 years ago

@carlHR Right now, you have no control (from the S2DTux side) of this. The new system should be a lot more flexible.

DanS2D commented 3 years ago

@carlHR This is now fixed with the new Android build system.

Download the latest version of S2DTux here: http://solar2dtux.com/index.php/download/

Then run the installer again and you should be good to go. Note: Do not run the installer with sudo/root. It'll ask for your password when it needs to do things elevated.

Thank you