Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

"attempt to call 'Nill' value in function 'require'."
Started by curtistaplin Oct 11 2019 06:02 AM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

curtistaplin

[GLOBAL: userInfoPane.html]
curtistaplin
  • Observer

  • 6 posts
  • Corona SDK

Hey,

I'm having an issue with my code.

 

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






[TOPIC: post.html]
#2

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 596 posts
  • Corona SDK

You need to make a reference for the plugin in your build.settings file

settings =
{
    plugins =
    {
        ["plugin.pasteboard"] =
        {
            publisherId = "com.coronalabs",
        },
    },
}

				
				

 



[TOPIC: post.html]
#3

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 596 posts
  • Corona SDK

Wait, I see you did that but that you have two settings and two plugins in your build. . .I'll take another look a little later



[TOPIC: post.html]
#4

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 596 posts
  • Corona SDK

OK, you had

settings --> settings --> plugins and another plugins that was blank

instead of

settings --> plugins

 

I took away the extra settings and the extra plugins, try this:

settings =
{
    orientation =
    {
        -- Supported values for orientation:
        -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
        default = "portrait",
        supported = { "portrait", },
    },
 
    --
    -- Android section
    --
    android =
    {
        usesPermissions =
        {
        "android.permission.INTERNET",
        },
    },
 
    --
    -- Plugins section
    --
    plugins =
    {
        ["plugin.pasteboard"] =
        {
            publisherId = "com.coronalabs",
        },
    },
 
    --
    -- iOS section
    --
    iphone =
    {
        xcassets = "Images.xcassets",
        plist =
        {
        UIStatusBarHidden = false,
        UILaunchStoryboardName = "LaunchScreen",
        },
    },
 
    --
    -- Project section
    --
    excludeFiles =
    {
    -- Exclude unnecessary files for each platform
        all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", },
        android = { "LaunchScreen.storyboardc", },
    },
}
 




[topic_controls]
[/topic_controls]