Build Error #1 - Plugins

I have similar, if not, exact problem when building for Android, using just debug key, and without any plugin in build.settings. It gives “Build Error #1”.

  • Where:
  • Build file ‘C:\Users\me\AppData\Local\Temp\Corona Labs\CLtmpa03076\template\app\build.gradle.kts’ line: 516

Building to window “exe” and html" are okay.

I am using Solar2D 2020.3601 Simulator on Windows 10 Home.

Lines (514 to 517) on “build.gradle.kts”, I found, were,

   if (execResult.exitValue != 0) {
        logger.error("Error while fetching plugins: $builderOutput")
        throw InvalidPluginException("Error while fetching plugins: $builderOutput")
    }

Lines (508 to 513) are,

  val execResult = exec {
        commandLine(coronaBuilder, "plugins", "download", "--android-offline-plugins", "builderInput=${builderInput.absolutePath}")
        standardOutput = builderOutput
        errorOutput = builderOutput
        isIgnoreExitValue = true
    }

It seems to be related to “plugins”. However, I was not using any plugins and there is no “plugins” section in the “build.settings”, in a very simple test program.

PS. I have just managed to successfully install Solar2D today. I have always been using the legacy Corona.

@luantiang This is the exact problem I am having.

On PC, I get a Build Error 1, with the same plugin error, even if I am not using any plugins. Running in the simulator is fine.

On Mac, it seems to compile into an APK, but when I load it to a device and use adb logcat, there are a ton of errors and crashes due to plugins missing.

Using 2020.2601 (and also tried 2020.3600). Funny thing is that this was working when I last tried it 2 weeks ago.

Today, I am trying again on my PC and I cannot even run the app in the simulator… I get errors for missing plugins… even when I copy the plugin directly into my app’s folder.

@vlads Any ideas?

Hello @schizoid2k.

2020.3601 is my first Solar2D. I have always been using the legacy Corona, till yesterday. I am not sure about earlier releases of Solar2D. Sorry, I only have MS Windows 10 Home Edition PC, and no Apple Mac.

I have “gone-back” to try a a basic “Hello World” app which I have used in the past. It does not use any plugins. In fact, there is no “config.lua” nor “build.settings”. It does not use any assets nor any module nor any “require”. In fact, it is just one “main.lua” file, with newText() and newLine().

It runs well in Solar2D simulator. It builds to and runs as Windows “exe” well. It builds to and runs on Web browser “html” well. But it fails to build to Android, with following error on simulator,

  • ERROR: Could not create build.properties:
  • Failed to access the “build.settings” file.
  • Android build failed (1) after 0 seconds.

This error “#1” may or may not be related to the above “#1” error. But if my memories served me right, this “Hello World” is one of those app that I ran, without problem, on many of the earlier legacy Corona releases.

I am not sure if it helps you or @vlads. Just sharing what I have observed so far.

I have un-installed 2020.3601 and installed 2020.3600 release version. Tried it with the same basic “Hello World” app, with only “main.lua” and “build.settings” files. No plugin and no “require”, with debug keystore. It gives the same results as below,

  1. Simulator run okay.
  2. Windows build “exe” run okay.
  3. Web build “html” run okay.
  4. Android build failed with messages below,
  • FAILURE: Build failed with an exception.
  • Build file ‘C:\Users\me\AppData\Local\Temp\Corona Labs\CLtmpa17280\template\app\build.gradle.kts’ line: 516
  • What went wrong: Error while fetching plugins:
  • Android build failed (1) after 8 seconds

My PC is Windows 10 Home Edition. Java version is “1.8.0_161”. Gradle version is “5.4.1”.

@vlads Please help to advise. Thanks!

I am running a different version of Java:

C:\java - version 

java version "11.0.7" 2020-04-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)

Last time I updated, I downloaded ‘jdk-11.0.7_windows-x64_bin.exe’ and installed it.

Looks like the current version is 11.0.8
https://www.oracle.com/java/technologies/javase-jdk11-downloads.html

I was hopeful for a moment… but I still has a sad :cry:

I am having the same problem as @luantiang… in fact I started this thread 2 weeks ago. Previously, everything was working, but for 2 weeks now, I get “Build Error #1 - Error while fetching plugins” when trying to build an Android app.

What I have tried, all to no avail:

On my PC, using 2020.3601, and then downgrading to 2020.3600:

  • Building a test app with no plugins, and I get the same “Build Error #1 - Error fetching plugins” message.
  • Building existing apps (with plugins… confirmed that all plugins are on the Free Plugin Directory, including my own authored “GBC” plugins which I cannot seem to use anymore), I get simulator errors on some plugins. For some other plugins, I do not get simulator errors, but when I try to build, I get an error that the plugin does not exist.
  • According to this page, I am supposed to install jdk-8u251-windows-i586.exe. I just tried @roaminggamer’s suggestion and installed jdk-11.0.7_windows-x64_bin.exe – same results

Then I moved to my Mac, and tried this with both 2020.3601 and 2020.3600:

  • I never get an error about missing plugins on the Simulator, but when I build an Android app, it appears to build successfully, but when I run it on my device (and use adb logcat), I see “missing plugins” errors in the adb log and the app crashes or freezes.

3rd Try:

  • I then tried building a Android app on a “new” Win10 PC… wiped the drive, installed Win10 and all updates, Solar2D, Java, and I get a “Build Error #1” error about plugins, whether I use plugins or not.

I have to say, 2 weeks of this is getting beyond frustrating. I have no idea what to try next. Any help appreciated.

–john

I still use your plugins so here are a couple of options (on a Mac):

  1. Make sure that your plugin is visible here (this folder called Solar2dPlugins is in my home directory):

Screen Shot 2020-07-15 at 10.43.04 PM

  1. If you get the simulator error make sure you have at least the lua stub here:

  1. And you probably know you can also just drop your plugin in the project folder inside the plugin folder. Just grab it from option 1 above:

Screen Shot 2020-07-15 at 10.56.56 PM

This is the version of java that I am using:

APhone:ISAmazon adriangomez$ java -version

openjdk version “1.8.0_242”

OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)

OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)

This is very unfortunate. Let’s try some things out.
Can you try running CoronaBuilder.exe from the Native/corona/win/bin

1 Like

I have found the step that makes the Android build works for me (for the first time since I moved from the legacy Corona to Solar2D on 25 June 2020).

  • Copy “lua.dll” into the folder, “Solar2D/Native/Corona/win/bin”.

Tested the build “apk” on an actual Android device, for both my “Hello World” and “Sample” apps. Works okay.

I am not sure if this is a solution. I am not sure if there should be a “lua.dll” in this folder, but it works for me. This may be related to my problem encountered with the anti-virus software. McAfee “false alarms” and “auto virus remove” may have to do with it.

This is the thread on the McAfee “false alarms”,
https://forums.solar2d.com/t/solar2d-windows-install-binaries-flagged-by-anti-virus/351693

I have configured “Do Not Scan These” on McAfee for all the “lua.dll” that I have on the PCs.

@schizoid2k Not sure if this step will work for you. You may want to check it out and give it a try if your “lua.dll” is missing there as well.

@roaminggamer Thanks for suggestion. I have both Java “1.8.0_161” and latest Java “14.0.2”. But Solar2D only picks up the “1.8.0_161” for its use (as seen on the simulator console). Maybe this has to do with that “1.8.0_161” is 32-bit and the “14.0.2” is 64-bit.

@agramonte I was not aware that there was an OpenJDK distribution out there. Thanks.

@vlads Many thanks. Your most recent advice guided me to to put the “lua.dll” in there.

Thank you everyone for your time!

I am making a bit of progress… but still have some issues.

@luantiang I did copy lua.dll to win/bin, and I can now compile an Android app that has no plugins!

@vlad The resulting error messages when I run CoronaBuilder.exe. It appears it is looking for the old Corona Marketplace. I am not sure why.

ERROR: plugin could not be validated: plugin.gpgs.v2 (com.coronalabs)
ERROR: Activate plugin at: https://marketplace.coronalabs.com/plugin/com.coronalabs/plugin.gpgs.v2
ERROR: plugin could not be validated: plugin.google.iap.v3 (com.coronalabs)
ERROR: Activate plugin at: https://marketplace.coronalabs.com/plugin/com.coronalabs/plugin.google.iap.v3
ERROR: plugin could not be validated: plugin.GBCDataCabinet (com.gamesbycandlelight)
ERROR: Activate plugin at: https://marketplace.coronalabs.com/plugin/com.gamesbycandlelight/plugin.GBCDataCabinet
ERROR: plugin could not be validated: plugin.flurry.analytics (com.coronalabs)
ERROR: Activate plugin at: https://marketplace.coronalabs.com/plugin/com.coronalabs/plugin.flurry.analytics
ERROR: plugin could not be validated: plugin.iap_badger (uk.co.happymongoose)
ERROR: Activate plugin at: https://marketplace.coronalabs.com/plugin/uk.co.happymongoose/plugin.iap_badger
ERROR: plugin could not be validated: plugin.admob (com.coronalabs)
ERROR: Activate plugin at: https://marketplace.coronalabs.com/plugin/com.coronalabs/plugin.admob
ERROR: exiting due to plugins above not being activated.

Hello,

my two cents on this issue (had a similar experience, no plugins, Simulator 2020.3601 (2020.6.25)):

When I run the corona simulator from ZeroBrane IDE I can test my app in the simulator but I get an error when building an android apk [Build Error #1]
When I open the Corona Simulator directly (as normal windows app) --> open the project in the simulator and then build an apk --> the build process is successful.

For me this works fine, I only have to remember that fact, as I am not building apks that often ;-))

ERRORS Building apks with Simulator started from ZeroBrane

[Build Error #1]

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\mk\AppData\Local\Temp\Corona Labs\CLtmpa09720\template\app\build.gradle.kts’ line: 516

  • What went wrong:
    Error while fetching plugins:

ERRORS Building apks with Simulator started from ZeroBrane

WINDOWS:
Version 1903 (Build 18362.900)

ZeroBrane Studio(1.90; mobBebug 0.706)

java -version
openjdk version “13.0.2” 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.2+8)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.2+8, mixed mode, sharing)

-mike

@schizoid2k How do you test your “coronaBuilder.exe”? Do you test it against a standard “build.settings” or a “builder input json”?

I tried with the standard “build.settings” file. First, it seems to hang. Second, I got the following error. Below is one failure instance,

ERROR: plugin could not be validated: CoronaProvider.native.popup.social (com.coronalabs)
ERROR: Activate plugin at: https://marketplace.coronalabs.com/plugin/com.coronalabs/CoronaProvider.native.popup.social
ERROR: exiting due to plugins above not being activated.

While I am not sure if my experimental method below is the right way to run “coronaBuilder.exe” (would need @vlads to confirm). I am just using trial-and-error method to figure things out. It is a custom-built-for-testing “builder input json” file. I tried three plugins in this json file.

  • Bytemap from Xibalba Studios
  • GBCDataCabinet
  • Social popup native

I checked the before-and-after state of the “Solar2dPlugins/Caches/…” to confirm if all the relevant plugins got downloaded, and copied to the right folders. It seem to works.

I also confirmed it with an app which has a “Bytemap” plugin from “com.xibalbastudios”. It was simulator built to an Android “apk” successfully. The “apk” was installed on an actual Android device, and it runs well.

Please let me know if you would like to try the experimental method, as above. Thank you.

@luantiang,

It was a bit of trial and error as well… I ran CoronaBuilder.exe (after copying lua.dll into the folder… thanks for that suggestion!) without arguments to see what the expected syntax is. I then ran it on an existing project:

CoronaBuilder.exe plugins download android <full path to my project)\build.settings

I tried it again this morning and got the same list of errors as above… it looks like it is trying (and failing) to connect to the old corona marketplace. I am also not 100% sure if the swytax is correct, but reading the help that is displayed, it looks like the “download” argument should pull down the plugins defined in the build.settings file… which is not happening.

I guess we will have to wait for @vlad to respond. I also see a new version was released yesterday, and I may give that a try.

@schizoid2k The “coronaBuilder.exe” command I use, with success, is following,

coronaBuilder plugins download --android-offline-plugins builderInput=build.json

where, “build.json” is the, I believe, parsed json file of “build.settings”. I have used, by trial-and-error and looking-for-source, the following “build.json”. I am not sure if every entry in this json file is required, but it seems to work for me.

{ "appName":"helloworld",
"appPackage":"com.solar2d.app.helloworld",
"build":"3600",
"buildData":"{
	\"isLaunchPadActive\":false,
	\"targetCertType\":\"developer\",
	\"targetPlatformVersion\":140300,
	\"debugBuildProcess\":5,
	\"targetDevice\":0,
	\"dailyBuildRevision\":3600,
	\"clientPlatform\":\"Win\",
	\"targetAppStore\":\"none\",
	\"targetPlatform\":1,
	\"plugins\":{
		\"plugin.GBCDataCabinet\":{
			\"publisherId\":\"com.gamesbycandlelight\"
		}, 
		\"plugin.Bytemap\":{
			\"publisherId\":\"com.xibalbastudios\"
		},
		\"CoronaProvider.native.popup.social\":{
			\"publisherId\":\"com.coronalabs\"
		}
	},
	\"dailyBuildYear\":2020,
	\"clientProductId\":\"basic\",
	\"appName\":\"helloworld\"
}",
"modernPlatform":"android",
"platform":"android",
"pluginPlatform":"android",
"destinationDirectory":"D:\\MySolar2DTest\\plugins" }

The “destinationDirectory” is where you would like the Android-only plugins to be copied to, after it gets downloaded to “…/Roaming/Solar2DPlugins/Caches/…” folder. I have included the 3 plugins I have tested with.

If successful, you can see all the 3 plugins get downloaded into the “Caches” and copied to your “destinationDirectory”.

I hope this helps. Good luck!

1 Like

@luantiang Thanks for the info, but no success. :cry:

No matter what I try, I get plugin errors. When I use CoronaBuilder command line, I see that it always tries to connect to the old Corona Marketplace to grab the plugins, and that fails.

@vlad Why would it be doing this? I tried this on my existing (previously working) development, and on a newly build Win10 machine as a test.

Well… here’s an update and its finally good news.

I tried every release hoping that the plugin issue I described above would go away, and it finally 2020.3607 did the trick! I can finally run my apps in the simulator and build Android apps without issue… with the exception of the Flurry plugin. Flurry will just not download.

So for all my apps, I disabled Flurry and rebuilt them all for the Android store. Everything seems operational (for now). I am not upgrading from this version for a while. :grinning:

I am not sure what was happening or what fixed the problem. I do notice there are some other “Build Error 1” and plugin threads recently on the forums. The errors that were showing in the console for my issue were somewhat generic that it was difficult to troubleshoot. Even trying everyone’s suggestions to download the plugins manually and/or using the newer build.settings URL strings did not help.

For my sake, I hope to get 2 more apps compiled over the next few days and then my Android appts will be up to date and will pass he store requirements.

failed to find mfc140u.dll
dll is in system32 and on the PATH env
Win10 64bit

Latest solar2d builds should have this files in root of the distribution. Try copying them near coronabuilder.exe

I have tried to copy win/system32 ones - another crash.
But ones from the distribution root works! Thanks.
Build is working now.

I have installed multiple versions of Microsoft Visual C++
now everything works