Photon plugin for Solar2D ERROR Unable to find plugin

With old Coronalabs latest release all was ok.

Now I tried the Solar2d 2020.3601. On mac.

On simulator I recevie these error but 'photon' seems works well .

Unable to find plugin 'plugin.photon' for platform 'mac-sim':
	Custom URL: skipped because no table supportedPlatforms provided for plugin.photon
	Locally: no directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/mac-sim/data.tgz'
	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/data.tgz'
	Solar2D Directory: plugin plugin.photon was not found at Solar2D Directory
	Ignore Missing checker: no plugin directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
Unable to find plugin 'plugin.photon' for platform 'lua':
	Custom URL: skipped because no table supportedPlatforms provided for plugin.photon
	Locally: no directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/lua/data.tgz'
	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/data.tgz'
	Solar2D Directory: plugin plugin.photon was not found at Solar2D Directory
	Ignore Missing checker: no plugin directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon

If I try to build an android project I receive an error code 256:

BUILD SUCCESSFUL
    Total time: 1 second
    Error while fetching plugins: ERROR: occured while collecting plugins for Android. 	Unable to find plugin 'plugin.photon' for platform 'android':
    	Custom URL: skipped because no table supportedPlatforms provided for plugin.photon
    	Locally: no directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
    	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/android/data.tgz'
    	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/data.tgz'
    	Solar2D Directory: plugin plugin.photon was not found at Solar2D Directory
    	Ignore Missing checker: no plugin directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
    Unable to find plugin 'plugin.photon' for platform 'lua':
    	Custom URL: skipped because no table supportedPlatforms provided for plugin.photon
    	Locally: no directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
    	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/lua/data.tgz'
    	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/data.tgz'
    	Solar2D Directory: plugin plugin.photon was not found at Solar2D Directory
    	Ignore Missing checker: no plugin directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon


    FAILURE: Build failed with an exception.

    * Where:
    Build file '/private/var/folders/zb/699hrw6d43g5wbljqcxf0fmm0000gn/T/CLtmpizKORq/template/app/build.gradle.kts' line: 516

    * What went wrong:
    Error while fetching plugins: ERROR: occured while collecting plugins for Android. 	Unable to find plugin 'plugin.photon' for platform 'android':
    	Custom URL: skipped because no table supportedPlatforms provided for plugin.photon
    	Locally: no directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
    	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/android/data.tgz'
    	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/data.tgz'
    	Solar2D Directory: plugin plugin.photon was not found at Solar2D Directory
    	Ignore Missing checker: no plugin directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
    Unable to find plugin 'plugin.photon' for platform 'lua':
    	Custom URL: skipped because no table supportedPlatforms provided for plugin.photon
    	Locally: no directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon
    	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/lua/data.tgz'
    	Locally: no file '/Users/rre/Solar2DPlugins/com.exitgames/plugin.photon/data.tgz'
    	Solar2D Directory: plugin plugin.photon was not found at Solar2D Directory
    	Ignore Missing checker: no plugin directory /Users/rre/Solar2DPlugins/com.exitgames/plugin.photon

what I’m making wrong ?

Thanks
Renato

We use Photon with the new offline Solar builds. Photon includes photon.lua in their examples…and we just use that rather than the plugin

local photon = require("photon")
local LoadBalancingClient = require("photon.loadbalancing.LoadBalancingClient")
local LoadBalancingConstants = require("photon.loadbalancing.constants")
local Logger = require("photon.common.Logger")
local tableutil = require("photon.common.util.tableutil")
local Array = require("photon.common.type.Array")
local PhotonTime = require("photon.common.util.time")
local byteutil = equire("photon.common.util.byteutil").

Thank you!
can you send me the link to the new example?
I will try to build the example.

also that “arrays, photonTime and byteutil” are new for me.

thanks!
Renato

Download the plugin here: https://www.photonengine.com/en-us/sdks#corona-sdkrealtimecorona

1 Like

Does not work.

I downloaded the file.

I replaced the photon.lua file with the one I had. It is in the same folder as the project.

Keep telling me he can’t find the library.

I also tried their example project, it gives me the same error.

;(

Renato

Are you requiring it as a plugin in build.settings? Remove that as you are using a local file - not technically a plugin.

All works perfect with the last coronaLabs release.

I found this on that page:

Solar2D Native

Using Corona Photon Plugin in a Solar2D Native project can reduce time which client spends on establishing connection to the server (with encryption enabled for authentication phase). Download plugin library for your platform and link it into app executable.

Android

iOS

iOS Simulator

on Android you download a “libplugin.photon.so” file.

Do you use that?
how can I link on my app executable ?

Thanks
Renato

Here is my build.settings

settings =
{
	iphone =
	{
		plist =
		{
			-- UIApplicationExitsOnSuspend = true, -- default is false
			CFBundleIconFile = "Icon.png",
			CFBundleIconFiles =
			{
				"Icon.png", 
				"Icon@2x.png", 
				"Icon-72.png", 
			},

		},
	},

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

	plugins =
	{
		-- key is the name passed to Lua's 'require()'
		["plugin.photon"] =
		{
			-- required
			publisherId = "com.exitgames",
		},
	},
}

on main.lua

if pcall(require,"plugin.photon") then -- try to load Corona photon plugin
    --print("Demo: main module:","Corona plugin used")
    photon = require "plugin.photon"    
    LoadBalancingClient = photon.loadbalancing.LoadBalancingClient
    LoadBalancingConstants = photon.loadbalancing.constants
    Logger = photon.common.Logger
else  -- or load photon.lua module
    --print("Demo: main module:","Lua lib used")
    photon = require("photon")
    LoadBalancingClient = require("photon.loadbalancing.LoadBalancingClient")
    LoadBalancingConstants = require("photon.loadbalancing.constants")
    Logger = require("photon.common.Logger")
end

thanks
Renato

I finally understand!

it was enough to delete the plugin request from the build.settings and everything went back in place.

so remove this:

plugins =
{
– key is the name passed to Lua’s ‘require()’
[“plugin.photon”] =
{
– required
publisherId = “com.exitgames”,
},
},

Thank you!

Thank you so much for this thread!! I couldn’t get this plugin to work as the documentation is outdated on the corona website and I was getting frustrated. This worked like a charm.

Is a pleasure.
Photon works well with corona.

Renato