Cannot run apps built with 2421 on Android

Not to sound too much like a noob, which I am; I still have the line:

local facebook = require(‘facebook’)

in my main.lua file.  Would this cause any issues?

I tried removing it and then changing it to:

local facebook = require(‘plugin.facebook’)

But both caused errors in the simulator.

Kevin

Remove this line from the facebook plugin line in your build.settings:

supportedPlatforms = { iphone=true, [“iphone-sim”]=true },

That line says only load the plugin if your building for iOS.  The require line is just:  local facebook = require(“facebook”)

Rob

That did it, thanks for your help, you are awesome!

I just updated to the new public release and received a very similar message.  It simulated fine, but when I packaged for Android and installed it on my device, I got the error when trying to launch.

Runtime Error

/Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:820:module ‘facebook’ not found:resource (facebook.lu) does not exist in archive

no field

package.preload[‘facebook’]

no file ‘(null)/facebook.lua’

no file ‘(null)/facebook.lua’

no file ‘/data/app-lib/com.gmail.kthompson200.Zant_s_Gravity_Racing_1-1/libfacebook.so’

no file ‘./facebook.so’

no file ‘(null)/facebook.so’

After I hit the back button on my device, I get the message "Unfortunately, Zant_s Gravity Racing 53 has stopped.

Fortunately, I built the same package and named it Zants Gravity Racing  52 just before updating Corona, so I uninstalled the errored version and installed the new version, which ran fine.  Is there something I need to change in the code with regard to the new public release?

Facebook is a now a plugin on Android.  Do you have it loaded in your build settings?

Rob

I really appreciate the reply Rob.  I stumbled across that today and suspect that was the problem.  As soon as I test it, I’ll post my results.

UPDATE:  I updated my build.settings as is below, but I’m still getting the error on my HTC One M8 when testing.  When I run it in the Windows simulator, everything runs fine.

settings =

{

android =

    {

        versionCode = “10”,

        usesPermissions =

        {

            “android.permission.INTERNET”,

            “android.permission.WRITE_EXTERNAL_STORAGE”,

            “android.permission.ACCESS_FINE_LOCATION”,

            “android.permission.ACCESS_COARSE_LOCATION”,

        },

        usesFeatures =

        {

            { name=“android.hardware.camera”, required=false },

            { name=“android.hardware.location”, required=false },

            { name=“android.hardware.location.gps”, required=false },

        },

        {

        largeHeap = true

        },

    },

orientation =

{

default = “landscapeRight”,

},

iphone = {

plist = {

            

UIStatusBarHidden = true,

            

UIApplicationExitsOnSuspend = true,

            

            FacebookAppID = “”,

            

            CFBundleURLTypes = {

                {

                CFBundleURLSchemes = { “fb”, }

                }

            }

},

},

plugins =

{

        [“facebook”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { iphone=true, [“iphone-sim”]=true },

        }, 

   [“plugin.GameThrivePushNotifications”] =

   {

       publisherId = “com.gamethrive”,

   },

   [“plugin.google.play.services”] =

   {

           publisherId = “com.coronalabs”,

           supportedPlatforms = { android=true },                

    },

},

}

Does everything look alright here?  Any ideas what I’m doing wrong?

Thanks,

Kevin

Not to sound too much like a noob, which I am; I still have the line:

local facebook = require(‘facebook’)

in my main.lua file.  Would this cause any issues?

I tried removing it and then changing it to:

local facebook = require(‘plugin.facebook’)

But both caused errors in the simulator.

Kevin

Remove this line from the facebook plugin line in your build.settings:

supportedPlatforms = { iphone=true, [“iphone-sim”]=true },

That line says only load the plugin if your building for iOS.  The require line is just:  local facebook = require(“facebook”)

Rob

That did it, thanks for your help, you are awesome!