Corona Admobs集成问题

我的build.settings配置

settings =
{
     orientation =
{
    default = "portrait",

},

android =
{
    versionCode = "11"
},

androidPermissions =
{
    "android.permission.INTERNET",
    "android.permission.WRITE_EXTERNAL_STORAGE",
    "android.permission.ACCESS_NETWORK_STATE",
    "android.permission.READ_PHONE_STATE",
},

build =
{
   neverStripDebugInfo = true
},
plugins =
   {
      ["CoronaProvider.ads.admob"] =
               {
                   publisherId = "com.coronalabs",
            supportedPlatforms = { ["android"] = true }
                 }
   }

}

我的main.lua文件

local background  = display.newImage("backgroundrain.png")
background.x = display.contentWidth / 2
background.y = display.contentHeight / 2
local provider = "admob"
local appID = ""
local ads = require "ads"
--按钮
local widget = require( "widget" )
provider = "admob"
appID = ""
AD_TYPE = "banner"
local ads = require( "ads" )

local button1 = widget.newButton
{
defaultFile = "finallpicture.png",
overFile = "finallpicture2.png",
label = "",
emboss = true,
onPress = "finallpicture2.png",
onRelease = "finallpicture2.png",
}
button1.x = 495; button1.y = 950

local theaudio = audio.loadStream("theaudio.mp3")

function button1:touch(e)
 if(e.phase == "ended") then
     audio.play(theaudio)
     end
end
button1:addEventListener("touch", button1)
local function adListener( event )
-- event table includes:
--      event.provider
--      event.isError (e.g. true/false )

local msg = event.response

-- just a quick debug message to check what response we got from the library
print("从广告库收到的消息:", msg)

if event.isError then
    statusText:setTextColor( 255, 0, 0 )
    statusText.text = "加载广告出错"
    statusText.x = display.contentWidth * 0.5

    showAd( "banner" )
else
    statusText:setTextColor( 0, 255, 0 )
    statusText.text = "广告加载成功"
    statusText.x = display.contentWidth * 0.5
end
end

-- 使用你想要使用的提供商初始化'ads'库。
if appID then
ads.init( provider, appID, adListener )
end

当我运行代码时,会出现一个弹窗窗口,显示“插件下载错误”。无法下载以下插件: com.coronalabs/CoronaProvider.ads.admob。

我知道我可能漏掉了一些重要的东西,但我已经尝试了几天调试。我阅读了关于Corona Admobs集成的论坛,但我仍然无法理解。

如果您有任何建议,我会非常感激。

点赞
用户3739502
用户3739502

如果您查看文档 ,您 adMob 插件的 build.settings 配置是错误的,根据文档进行替换:

plugins =
   {
      ["CoronaProvider.ads.admob"] =
               {
                   publisherId = "com.coronalabs",
            supportedPlatforms = { ["android"] = true }
               }
   }

   plugins =
   {
       ["plugin.google.play.services"] =
       {
           publisherId = "com.coronalabs",
           supportedPlatforms = { iphone=false, android=true }
       },
   },

来替换。

2016-03-09 02:08:33