About publishing to Android problem ( terminal )

When I tried to upload my game to google, I have this error

You uploaded an APK that was signed in debug mode. You need to sign your APK in release mode.

And then I found out the solution in corona docs.

However, I also have problem in terminal 

I type 

cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin

after that 

keytool -genkey -v -keystore RunArcade.keystore -alias RunArcade -keyalg RSA -validity 999999

And then I set up the password and type my name. the location thing

And I have this problem

keytool error: java.io.FileNotFoundException: RunArcade.keystore (Permission denied)

java.io.FileNotFoundException: RunArcade.keystore (Permission denied)

at java.io.FileOutputStream.open(Native Method)

at java.io.FileOutputStream.<init>(FileOutputStream.java:194)

at java.io.FileOutputStream.<init>(FileOutputStream.java:84)

at sun.security.tools.KeyTool.doCommands(KeyTool.java:902)

at sun.security.tools.KeyTool.run(KeyTool.java:172)

at sun.security.tools.KeyTool.main(KeyTool.java:166)

And i also can read and write in this mac.

First of all you don’t need to do the change directory command (cd) to go into a place you don’t have write access tool.  In fact, the next command isn’t running the keytool in that folder anyway.  It’s running one somewhere in the system path.  On my computer the one that runs is in /usr/bin.  You can check yourself:

which keytool

will tell you where it’s really running it from.  You probably should do a “cd” command and go somehwere, but there really isn’t a standard place to store your keystores.  So for fun let’s put it in your Desktop.

cd ~/Desktop

from that just run the keytool command.  It will output your keystore file on your Desktop.

Rob

and i have a problem when i build for iOS 

I have this in my main.lua

[lua]local licensing = require( “licensing” )
licensing.init( “google” )

local function licensingListener( event )
local verified = event.isVerified
if event.isVerified then

–THE APP HAS BEEN VERIFIED BY GOOGLE.
–DO STUFF, LIKE GO TO ANOTHER SCENE.

print (“hi”)

else
native.showAlert( “Licensing Failed!”, “There was a problem verifying the application, please try again.”, { “OK” } )
end
end

licensing.verify( licensingListener )[/lua]

and this in config.lua 

[lua]if ( string.sub( system.getInfo(“model”), 1, 4 ) == “iPad” ) then

   application =

   {

      content =

      {

         width = 360,

         height = 480,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

   

   elseif ( string.sub( system.getInfo(“model”), 1, 2 ) == “iP” and display.pixelHeight > 960 ) then

   application =

   {

      content =

      {

         width = 320,

         height = 568,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

   

   elseif ( string.sub( system.getInfo(“model”), 1, 2 ) == “iP” ) then

   application =

   {

      content =

      {

         width = 320,

         height = 480,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

   

   elseif ( display.pixelHeight / display.pixelWidth > 1.72 ) then

   application =

   {

      content =

      {

         width = 320,

         height = 570,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

else

   application =

   {

      content =

      {

         width = 320,

         height = 512,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

end[/lua]

and this in build.setting

[lua] android =
{
usesPermissions =
{
“android.permission.INTERNET”,
“com.android.vending.CHECK_LICENSE”,
“com.android.vending.BILLING”,
},
},[/lua]

and when i build for iOS, i has runtime error when i install it to my iPhone through Xcode device

and nothing happen in simulator

Error: could not load provider (google) due to the following reason:module ;CoronaProvider.licensing.google’ not found:resource

and a lot of words… What actually happened??

do i need to separate the file for iOS build and android build??

Licensing is a Google Android only feature.  None of that code is going to anything on iOS.  To avoid the errors though, you need to test to see if you’re on Android or not.  You can use:

if "Android" = system.getInfo( "platformName" ) then &nbsp;&nbsp; -- do your Android only features here end

Rob

First of all you don’t need to do the change directory command (cd) to go into a place you don’t have write access tool.  In fact, the next command isn’t running the keytool in that folder anyway.  It’s running one somewhere in the system path.  On my computer the one that runs is in /usr/bin.  You can check yourself:

which keytool

will tell you where it’s really running it from.  You probably should do a “cd” command and go somehwere, but there really isn’t a standard place to store your keystores.  So for fun let’s put it in your Desktop.

cd ~/Desktop

from that just run the keytool command.  It will output your keystore file on your Desktop.

Rob

and i have a problem when i build for iOS 

I have this in my main.lua

[lua]local licensing = require( “licensing” )
licensing.init( “google” )

local function licensingListener( event )
local verified = event.isVerified
if event.isVerified then

–THE APP HAS BEEN VERIFIED BY GOOGLE.
–DO STUFF, LIKE GO TO ANOTHER SCENE.

print (“hi”)

else
native.showAlert( “Licensing Failed!”, “There was a problem verifying the application, please try again.”, { “OK” } )
end
end

licensing.verify( licensingListener )[/lua]

and this in config.lua 

[lua]if ( string.sub( system.getInfo(“model”), 1, 4 ) == “iPad” ) then

   application =

   {

      content =

      {

         width = 360,

         height = 480,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

   

   elseif ( string.sub( system.getInfo(“model”), 1, 2 ) == “iP” and display.pixelHeight > 960 ) then

   application =

   {

      content =

      {

         width = 320,

         height = 568,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

   

   elseif ( string.sub( system.getInfo(“model”), 1, 2 ) == “iP” ) then

   application =

   {

      content =

      {

         width = 320,

         height = 480,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

   

   elseif ( display.pixelHeight / display.pixelWidth > 1.72 ) then

   application =

   {

      content =

      {

         width = 320,

         height = 570,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

else

   application =

   {

      content =

      {

         width = 320,

         height = 512,

         scale = “letterBox”,

         xAlign = “center”,

         yAlign = “center”,

         imageSuffix =

         {

            ["@2x"] = 1.5,

            ["@4x"] = 3.0,

         },

      },

      

      license =

      {

         google =

         {

            key = “the very long key”,

            policy = “serverManaged”,

         },

      },

   }

end[/lua]

and this in build.setting

[lua] android =
{
usesPermissions =
{
“android.permission.INTERNET”,
“com.android.vending.CHECK_LICENSE”,
“com.android.vending.BILLING”,
},
},[/lua]

and when i build for iOS, i has runtime error when i install it to my iPhone through Xcode device

and nothing happen in simulator

Error: could not load provider (google) due to the following reason:module ;CoronaProvider.licensing.google’ not found:resource

and a lot of words… What actually happened??

do i need to separate the file for iOS build and android build??

Licensing is a Google Android only feature.  None of that code is going to anything on iOS.  To avoid the errors though, you need to test to see if you’re on Android or not.  You can use:

if "Android" = system.getInfo( "platformName" ) then &nbsp;&nbsp; -- do your Android only features here end

Rob