Installing plugin? (pasteboard)

Hey,

I’m looking to use the Pasteboard plug in for a project I’m working on. I’ve downloaded the plug in from Github, I’ve tried to put the plug in in my corona project <coronaproject>/plugins/pasteboard . I’ve also tried pasting the files in the plugin directory of the Corona SDK. Where am I going wrong?

-Curtis

If you have problems with your code, then the best way towards fixing them is by sharing said code.

All I can tell you now is to read documentation https://docs.coronalabs.com/plugin/pasteboard/index.html

Go here:  https://marketplace.coronalabs.com/corona-plugins/pasteboard

Activate the plugin.

Click on the documentation link and follow the instructions there.

Rob

Here’s my code I’m now getting an error which states:  '0 attempt to call nill value in function require main.lua 9

local pasteboard = require( “plugin.pasteboard” )

txtstring = “Test text string”

pasteboard.copy(“string”,txtstring)

Here are my 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 = “portrait”,

supported = { “portrait”, },

},

– Android section

android =

{

usesPermissions =

{

“android.permission.INTERNET”,

},

},

settings =

{

    plugins =

    {

        [“plugin.pasteboard”] =

        {

            publisherId = “com.coronalabs”,

        },

    },

}

– 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”, },

},

}

Your build.settings file appears to be malformed. First, it’s really hard to read it because you’re not using code formatting. When posting code, click the blue <> button and paste the code in the popup window. Secondly, you may not be maintaining your indents in your text editor. It’s really important with Lua nested tables that you use proper indention. It’s almost impossible to figure out which opening curly brace goes with it’s matching  closing curly brace.

You do also seem to have multiple “plugin” sub-tables; the last one blowing away the first reference, basically telling it to not load any plugins. You also seem to have a settings table inside the outside settings table.

A basic build.settings is something like this:

settings = { orientation = { default = "portrait", supported = { "portrait", }, }, android = { usesPermissions = { "android.permission.INTERNET", }, }, iphone = { xcassets = "Images.xcassets", plist = { UILaunchStoryboardName = "LaunchScreen", UIStatusBarHidden = true, }, }, plugins = { ["plugin.pasteboard"] = { publisherId = "com.coronalabs" }, }, excludeFiles = { -- Exclude unnecessary files for each platform all = { "Icon.png", "Icon-\*dpi.png", "Images.xcassets", "\*.psd"}, android = { "LaunchScreen.storyboardc", }, }, }

Notice how each sub-table is nicely indented and there is only one version of each sub-table. See how the curly braces line up to show you the content of each block. You probably can copy/paste this which I think has all of your elements in it.

Rob