Android build failure

Android build fails. While compiling, the console shows “Build failed with an exception”, namely “build.gradle.kts line: 549”. Next, I get another message “Error while fetching plugins:”, which is weird since I do not use any plugins at all. An EXE compilation works well.

Hello Stan87,

Firstly, welcome to the Solar2D community.

Here are some questions that could help the community members here to help you.

(-1-) which Solar2D build / release?
https://github.com/coronalabs/corona/releases/

(-2-) which Windows OS version?

(-3-) are you using anti-virus software? if yes, which one?

(-4-) Do a quick check of the presence of “lua.dll” in the following folders on your PC. Is “lua.dll” present on both places?

  • C://Programs Files (x86)/{Solar2D install-folder}/ and,
  • C://Programs Files(x86)/{Solar2D install-folder/}/Native/Corona/win/bin/
1 Like

Thank you for your quick response!

  1. Build 2021.3641
  2. Windows 10 Home; 1909 Build
  3. Only preinstalled Windows Defender
  4. The lua.dll is present in both folders

Please post your build settings.

1 Like

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

android =
{
	usesPermissions =
	{
		"android.permission.INTERNET",
	},
},

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

plugins =
{

},

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

}

I believe, regardless whether you have a “plugins” section in your “build.settings”, the “Android Build” will go through an “Authorizing plugins” process, and it is likely this is where the error occurs.

Perhaps, you could turn on “verbose debug mode” which, hopefully, could give you more clues where the error occurs.

Using the Windows PowerShell (Admin), [Windows Key]+[X key]

reg ADD "HKEY_CURRENT_USER\Software\Ansca Corona\Corona Simulator\Preferences" /f /v debugBuildProcess /d 5

Re-run the “Android Build” and share any additional error message around these area on your “Simulator Console”,

> Configure project :App
Authorizing plugins
Plugins collector output:
1 Like

Try it without the plugin section.

1 Like

deleting the modules section does not help, indeed. The verbose debug mode provides the following information:

Authorizing plugins
Error while fetching plugins:
FAILURE: Build failed with an exception.

  • Where: Build file ‘C:\Users\HP\AppData\Local\Temp\CoronaLabs\CLtmpa07044\template\app\build.gradle.kts’ line: 549

  • 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.

See https://docs.gradle.org/6.8.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 11s
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
Android build failed (1) after 13 seconds

Please help to check your java “JRE”,

On Windows Command Prompt, run,

C:\> java -version
C:\> path

https://github.com/coronalabs/corona/releases/tag/3641

I just saw that build “2021.3641” is the first build using x64 JRE. All these while, the past builds have been using x86 JRE (in particular, JDK8).

https://docs.coronalabs.com/guide/start/installWin/index.html#java-development-kit

I am currently running an older build on my PC, with x86 JRE. So, I am not sure if which version of x64 JRE is required, or if the Solar2D “2021.3641” install process already bundle in the required x64 JRE.

1 Like

To reduce the turn-around and to speed thing up (possibly due to different times or timezones many of us are in), below are possible actions, depending on the Java JRE and Solar2D release.

(-1-) If your current JRE is 32-bit x86,

  • Update your JRE to 64-bit x64 if you want to continue to use the “2021.3641” release.
  • However, I am not sure which x64 JRE version is needed for “2021.3641” release. This would need our Solar2D principal developer, Vlad Svoka @vlads, to help to advise.
  • Or go ahead and try any version of x64 JRE.

(-2-) If your current JRE is 32-bit x86,

  • You can choose to “back-track” the release to an earlier release before “2021.3641”.
  • These earlier release uses x86 JRE.
  • Please ensure your x86 JRE follows the guideline in the doc below,

https://docs.coronalabs.com/guide/start/installWin/index.html#java-development-kit

(-3-) If you current JRE is already x64,

  • One possible cause could be your version is not the x64 JRE version required for “2021.3641” releases.
  • This would need Vlad to confirm this.
  • Or, if it is the already the right x64 JRE version, then the problem could lie elsewhere.
1 Like

I have an idea what’s going on. May be some dll is missing for CoronaBuilder. Try starting it manually from Native/Corona//win32/bin

1 Like

Hello Vlads,

  • Which x64 JRE version is required for “2021.3641” release?
  • Is the x64 JRE bundled in during the installation of this release?
  • If it is x64 JRE required for this release onwards, then the documentation needs to be updated to reflect this.

Thanks.

1 Like

So, x64 version of JRE is included, you can check specific version with running jre/bin/java.exe -version if you want. That is proper version to build on x64 machines, same as shipped with Android Studio.
Yes, it is bundled in jre directory. If you rename/delete that directory Solar2D would try to use system installed Java.
Documentation needs to be changed indeed.

But your problem is not with JRE. You have issues running CoronaBuilder.exe, so “collect plugin” fails. If you got to that stage JRE is already OK.

1 Like

Folks, thank you for your help again.
I downgraded the Solar2D version to that one that doesn’t use the x64 JRE and couldn’t even launch the simulator due to 0xc00007b error. Then, I downloaded the latest release - 2021.3642. I can launch it, but the Android build fails as before. Having scrutinized the log, I found some messages that may help to shed light on my issue:

  • Detected Java version: 1.6 in: C:\Program Files (x86)\Corona Labs\Corona\jre\jre (isn’t it old? and why jre/jre instead of jre/bin)
    *Unable to find C:\Program Files (x86)\Native\Corona\android. Condition false; not setting corona.native.android
  • Unable to find …\androi. Condition false; not setting corona.native.android
  • Detected Java version: 1.6 in: C:\Program Files (x86)\Corona Labs\Corona\jre\jre (isn’t it old? and why jre/jre instead of jre/bin)
  • Unable to find C:\Program Files (x86)\Native\Corona\android. Condition false; not setting corona.native.android
  • Unable to find …\androi. Condition false; not setting corona.native.android

Are the above messages generated via the “verbose debug mode”? If they are, I believe most are within norms, as the “verbose debug mode 5” shows up many of the steps, and not only errors, as the build process go through.

Below is what I believe them to be, though I am not 100% sure,

  • The first could be due to “ant” process doing Java and OS version discovery, before going through the build files. I am not sure about “1.6” though. On my PC, it also says “1.6” on my x86 JRE, as follows,

      Detected Java version: 1.6 in: C:\Program Files (x86)\Java\jdk1.8.0_161\jre
    
  • The second. You can double check. This folder should be automatically installed,

      C:\Program Files (x86)\{install-name,eg,CoronaLabs}\Native\Corona\android\resource\
    

There should be a “android-template.zip” file inside this folder.

  • The last one could be a flag which it tells itself that this is not a native build, but a simulator build.

Just to recap and confirm, are you now at?

  1. Build 2021.3642
  2. Windows 10 Home; 1909 Build
  3. Java ???

And the Android build process breaks with errors at, right?

Authorizing plugins
Error while fetching plugins:
FAILURE: Build failed with an exception.

  • Where: Build file ‘C:\Users\HP\AppData\Local\Temp\CoronaLabs\CLtmpa07044\template\app\build.gradle.kts’ line: 549
  • 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.
1 Like

Hello,

I just downloaded the latest build 2021.3642 and have similar issue. When I go to “C:\Program Files (x86)\Corona Labs\Corona\Native\Corona\win\bin” and run CoronaBuilder.exe, it said mpc140u.dll not found.

I just copy all DLLs from “C:\Program Files (x86)\Corona Labs\Corona” to “C:\Program Files (x86)\Corona Labs\Corona\Native\Corona\win\bin”. Then re-run the build. Bingo.

Have a try.

2 Likes

I tried, and it works! Finally, the solution is found. As I understand, an installation process, for some reasons, does not put DLLs needed into the C:\Program Files (x86)\Corona Labs\Corona\Native\Corona\win\bin folder.

Thank you!

Well done. Thanks for sharing!

1 Like

Glad it finally works for you. All the best to your apps dev.

In case you want to set the “verbose debug mode” back. Just replace the “5” with “1”.

1 Like