Error with expansion files

Hi,

i tried to download my app in “beta mode” from  google play.

App download is ok, expansion file seems to be ok too.

But when i start the app i’ve got the following error appear on the device screen :

"java.lang.SecurityException: neither user 10xxx nor current process has com.android.vending.CHECK_LICENSE"

DDMS tell this :

V/Corona ( 3724): \> Class.forName: network.LuaLoader V/Corona ( 3724): \< Class.forName: network.LuaLoader V/Corona ( 3724): Loading via reflection: network.LuaLoader V/Corona ( 3724): \> Class.forName: CoronaProvider.licensing.google.LuaLoader V/Corona ( 3724): \< Class.forName: CoronaProvider.licensing.google.LuaLoader V/Corona ( 3724): Loading via reflection: CoronaProvider.licensing.google.LuaLoader I/Corona ( 3724): Runtime error I/Corona ( 3724): java.lang.SecurityException: Neither user 10xxx nor current process has com.android.vending.CHECK\_LICENSE. I/Corona ( 3724): Java Stack Trace: I/Corona ( 3724): android.app.ContextImpl.enforce(ContextImpl.java:1334) I/Corona ( 3724): android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1363) I/Corona ( 3724): android.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:395) I/Corona ( 3724): CoronaProvider.licensing.google.LuaLoader.verify(LuaLoader.java:187) I/Corona ( 3724): CoronaProvider.licensing.google.LuaLoader$VerifyWrapper.invoke(LuaLoader.java:431) I/Corona ( 3724): com.ansca.corona.JavaToNativeShim.nativeResize(Native Method) I/Corona ( 3724): com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:259) I/Corona ( 3724): com.ansca.corona.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:355) I/Corona ( 3724): com.ansca.corona.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611) I/Corona ( 3724): com.ansca.corona.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377) I/Corona ( 3724): stack traceback: I/Corona ( 3724): [C]: ? I/Corona ( 3724): [C]: in function 'verify' I/Corona ( 3724): ?: in function \<?:63\> I/Corona ( 3724): ?: in main chunk I/Corona ( 3724): Runtime error I/Corona ( 3724): I/Corona ( 3724): stack traceback: I/Corona ( 3724): [C]: ? I/Corona ( 3724): [C]: in function 'verify' I/Corona ( 3724): ?: in function \<?:63\> I/Corona ( 3724): ?: in main chunk

this is in my build.setting

settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight" }, }, android = { versionCode = "11", usesExpansionFile = true, usersPermissions = { "android.permission.RECORD\_AUDIO", "android.permission.SET\_ORIENTATION", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.INTERNET", "com.android.vending.CHECK\_LICENSE", "android.permission.WRITE\_EXTERNAL\_STORAGE" }, supportsScreens = { smallScreens = false, normalScreens = false, largeScreens = true, xlargeScreens="true", requiresSmallestWidthDp="600" }, }, iphone = { plist = { UIAppFonts = { "Aparajita.ttf"}, UIApplicationExitsOnSuspend = true, UIStatusBarHidden = true, CFBundleIconFile = "Icon.png", MinimumOSVersion = "5.1.1", CFBundleIconFiles = { "Icon.png" , "Icon@2x.png" , "Icon-76.png" , "Icon-76@2x.png" , "Icon-Small-50.png" , "Icon-Small-50@2x.png" , "Icon-Small-40.png" , "Icon-Small-40@2x.png", }, }, }, }

my main.lua

-- hide device status bar display.setStatusBar( display.HiddenStatusBar ) local licensing = require( "licensing" ) licensing.init( "google" ) local function licensingListener( event ) &nbsp; &nbsp;local verified = event.isVerified &nbsp; &nbsp;if not verified then &nbsp; &nbsp; &nbsp; --failed verify app from the play store, we print a message &nbsp; &nbsp; &nbsp; local paragraph = require("src.classes.Paragraph") &nbsp; &nbsp; &nbsp; local txt = {"i know you are not bad, but what you do is not good :)","Please buy our book from google play"} &nbsp; &nbsp; &nbsp; local tf = paragraph:new(group, 300, "left") &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;for i=1,#txt do &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tf:createLine(txt[i], fontType, {0, 0, 0}, 30, 35) &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;end &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;tf:position(250,350) &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; else &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;--do all my app need &nbsp;&nbsp;&nbsp;&nbsp;end end licensing.verify( licensingListener ) &nbsp;

my config.lua :

application = { content = { width = 800, height = 1280, scale= "zoomEven", xAlign = "center", yAlign = "center", }, license = { google = { key = "looooonnnnngggg string" }, }, }

does anyone know what happens ?

Thanks a lot.

That error message is telling you that your app is missing the “CHECK_LICENSE” Android permission.  It’s needed for Google Licensing, which is required for expansion file support.

Please see the following documentation for more details…

   http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#expansion-files

   http://docs.coronalabs.com/guide/basics/configSettings/index.html#google-licensing

   http://developer.android.com/google/play/expansion-files.html

Thank you Joshua for your answer,

but if we look at my code, i’ve done the licensing process like in the tutorials and in the documentation 

add  

usesExpansionFile = true, usersPermissions = { "android.permission.INTERNET", "com.android.vending.CHECK\_LICENSE", "android.permission.WRITE\_EXTERNAL\_STORAGE" }, &nbsp;

in build.setting, then add :

local licensing = require( "licensing" ) licensing.init( "google" ) local function licensingListener( event ) &nbsp; &nbsp;local verified = event.isVerified &nbsp; &nbsp;if not verified then &nbsp; &nbsp; &nbsp; -- pirates &nbsp; &nbsp; else &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;--do all my app need &nbsp;&nbsp;&nbsp;&nbsp;end end licensing.verify( licensingListener ) &nbsp;

in main.lua and finally add license key in config.lua

I’ve done 11 versions… i’ve read lot of docs.

Am i blind ? :slight_smile:

Thank for your help !

You have a typo in your “build.settings” file.

Change “usersPermissions” to “usesPermissions”.

:rolleyes: okay it’s time to go to bed for me ! 

I’ll try immediately, thank you

No problem.  Happy to help!  :slight_smile:

It’s OK, thank you Joshua

That error message is telling you that your app is missing the “CHECK_LICENSE” Android permission.  It’s needed for Google Licensing, which is required for expansion file support.

Please see the following documentation for more details…

   http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#expansion-files

   http://docs.coronalabs.com/guide/basics/configSettings/index.html#google-licensing

   http://developer.android.com/google/play/expansion-files.html

Thank you Joshua for your answer,

but if we look at my code, i’ve done the licensing process like in the tutorials and in the documentation 

add  

usesExpansionFile = true, usersPermissions = { "android.permission.INTERNET", "com.android.vending.CHECK\_LICENSE", "android.permission.WRITE\_EXTERNAL\_STORAGE" }, &nbsp;

in build.setting, then add :

local licensing = require( "licensing" ) licensing.init( "google" ) local function licensingListener( event ) &nbsp; &nbsp;local verified = event.isVerified &nbsp; &nbsp;if not verified then &nbsp; &nbsp; &nbsp; -- pirates &nbsp; &nbsp; else &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;--do all my app need &nbsp;&nbsp;&nbsp;&nbsp;end end licensing.verify( licensingListener ) &nbsp;

in main.lua and finally add license key in config.lua

I’ve done 11 versions… i’ve read lot of docs.

Am i blind ? :slight_smile:

Thank for your help !

You have a typo in your “build.settings” file.

Change “usersPermissions” to “usesPermissions”.

:rolleyes: okay it’s time to go to bed for me ! 

I’ll try immediately, thank you

No problem.  Happy to help!  :slight_smile:

It’s OK, thank you Joshua