Android Build Fails

I’ve used Solar 2D or Corona for a long time but haven’t actually rebuilt an app for a few weeks.

Now, even the simplest “Hello World” application fails with the following error message:

Warning: Dependant package with key emulator not found!

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ‘:App:bundleReleaseResources’.

Failed to install the following SDK components:
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
Install the missing components using the SDK manager in Android Studio.


I’ve tried installing latest Solar2D release (3639) and latest Jave SE release but makes no difference.

I have seen other posts of a similar nauture, but could not see what the solution was, if there is one.

Any help appreciated, as I’m unable to do anything until this is fixed. I’m only an amateur fun programmer, so simple instructions would be appreciated!

Hello!
Are you using Windows or macOS?

Hi Vlad,

Windows

Dave

I’ve just tried deleting Solar2D, Java SDK and Android from my Windows PC and then reinstalling the latest Solar2D build and the latest Java SDK.

When I try to build anything I now get this error

Solar2D Simulator 2021.3639 (Feb 22 2021 19:34:16)

Copyright © 2009-2021 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2021.3639
Platform: My Custom Device / x64 / 10.0 / GeForce GT 640/PCIe/SSE2 / 4.6.0 NVIDIA 456.71 / 2021.3639 / en_GB | GB | en_GB | en
Loading project from: H:\My Docs\Corona Projects\simple
Project sandbox folder: C:\Users\David\AppData\Local\Corona Labs\Corona Simulator\Sandbox\simple-331F76A018CBDB3C38FB87DCEF0D1583\Documents
hello
Testing credentials for ‘C:\Program Files (x86)\Corona Labs\Corona\Resources\debug.keystore’:
jar signed.

Warning:
The signer’s certificate is self-signed.

The timestamp will expire on 2031-01-06.
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
Excluding specified files from build:
excluding: LaunchScreen.storyboardc
excluding: Icon.png
excluding: Icon-*dpi.png
excluding: Images.xcassets
Error while fetching plugins:

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\David\AppData\Local\Temp\Corona Labs\CLtmpa12420\template\app\build.gradle.kts’ line: 545

  • What went wrong:
    Error while fetching plugins:

  • 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 24s
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
Android build failed (1) after 28 seconds

One thing I am unsure of is that the instructions for getting started with Solar2D say to download the x86 version of Java SDK, which is what I have done. However my PC is x64 so is this right?

Dave

As the error states it looks like you don’t have the 28.0.3 build tools and you should use the SDK manager in Android Studio to download them.

I’m confused. The instructions for getting started with Sonar2D say there is no need to have Android installed in order to create build for Android. Also no mention of having to download Android Studio.

Do I just download it and let it do a basic default installation?

I have already tried this. I downloaded 28.0.3 in Android Studio, but Solar2d does not see the android sdk that comes with Android Studio. He has his own copy somewhere else.

I think you are right. I just installed it and it made no difference. It says that the Android SDK Build Tools are installed.

Still getting FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\David\AppData\Local\Temp\Corona Labs\CLtmpa11840\template\app\build.gradle.kts’ line: 545

Could this be due to having x86 version of Java installed instead of x64 version?

  1. It has nothing to do with the java version. The error is clear.
  2. If your SDK manager is not pointing to the same location as Corona you can switch that or just copy and paste the SDK to the corona location (in windows 10 it is here):
    C:\Users\me\AppData\Roaming\Corona Labs\Corona Simulator\Android Build\sdk\build-tools
  3. If you want to wait for @vlads to fix the mismatch of the version that the latest version of solar2d is downloading and what it is expecting, I suspect that @vlads will do it soon enough.

But it is an open-source project so you could just fix it yourself and if you are so inclined you can probably even find the mismatch in the GitHub repo, fix it, and submit a pull request.

1 Like

I really don’t want to know how solar2d works internally. This is not my skill level. Sorry.

And like I said in my first post, I also am just an amateur programmer who likes coding games for fun, not fixing problems in others applications, even if I had the skills.

Also the location C:\Users\me\AppData\Roaming\Corona Labs\Corona Simulator\Android Build\sdk\build-tools already has the 28.0.3 folder present there.

Dave

I found a solution.

  1. Install Android Studio.
  2. Download build tools 28.0.3
  3. Copy directory “28.0.3” from Android Studio android sdk to solar2d android sdk. In my case it is:
    from (android studio copy)
    D:\Android\sdk\build-tools
    to (solar2d copy)
    C:\Users\yashu\AppData\Roaming\Corona Labs\Corona Simulator\Android Build\sdk\build-tools

After that, build ended successfully.

1 Like

Looks like what I suggested in item 2 above. But in any case, I am glad you got it working @yashureg

So your first issue you posted was:

  • What went wrong:
    Could not determine the dependencies of task ‘:App:bundleReleaseResources’.

Failed to install the following SDK components:
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
Install the missing components using the SDK manager in Android Studio.

At some point, you managed to get that fixed. And then you posted again with a different issue:

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\David\AppData\Local\Temp\Corona Labs\CLtmpa12420\template\app\build.gradle.kts’ line: 545
  • What went wrong:
    Error while fetching plugins:

For the second issue you will need to post what your build settings looks like since the error clearly states that it was not able to download the plugins.

Ok. We found solution. =)

1 Like

I’m sorry if this is a stupid question, but all I did was let the Simulator create a default project, which contained a config.lua file as follows:

– For more information on config.lua see the Project Configuration Guide at:
https://docs.coronalabs.com/guide/basics/configSettings

application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,

	--[[
	imageSuffix =
	{
		    ["@2x"] = 2,
		    ["@4x"] = 4,
	},
	--]]
},

}

I can’t see any options for configuring Build settings, but I see there is a file called build.settings which contains the following:

settings =
{
orientation =
{
– Supported values for orientation:
– portrait, portraitUpsideDown, landscapeLeft, landscapeRight
default = “portrait”,
supported = { “portrait”, },
},

--
-- 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", },
},

}

I can’t see any menu options for configuring the Build settings in the Simulator menus. Is there anything in the above that explains the problem I am having?

Doesn’t look like you have any plugins. So try to build again and then look at the path above and post it in gist with the line of the error. Once you get all these build issues ironed out on your machine, I promise things get easier. The path might not be exactly the same with the new build but the error will tell you the path.

agramonte,

Thanks for trying to help me sort this out.

I tried again and it failed with the same error, but then I realised that your post implied that there was a new build to try. I downloaded that and both the simple “Hello World” test application that I had been using to test the build process, and the real application I have been developing for a while now both build OK.

I don’t understand why, as the only change to the latest build doesnt seem to have any relevance to my issue. Perhaps its because I’ve reinstalled the latest Java SDK before I tried the new install?

Dave

1 Like

Hey. Just FYI, Solar2D would ignore Android Studio’s SDK or system Java installed. It has its own SDK installed at %appdata%\Corona Labs\Corona Simulator\Android Build\sdk It seems that automatic installation process broke at some point and I’m trying to figure out what happened.

1 Like

OK… So now to the “sad” solution. May I ask to try replacing C:\Program Files (x86)\Corona Labs\Corona\jre with contents of this archive: https://mega.nz/file/hSggiQ5b#CIifISV-HpVYqUpJtfheLcCvAQNOzWywGShsZC5FMOk
I suspect that Google botched 32bit java support on update :frowning: