Android Permission Error

Good evening,

I would appreciate any and all help with this mind boggling problem. Thank you in advance for your time and attention. My small team and I have built an app that converses with a MSQL database on our server that corresponds to GPS locations. We’ve built the app for iOS and it runs flawlessly. In fact, in the simulator, the app seems to work fine on android as well. Unfortunately, when we build it for the device we get the error:

java.lang.SecurityException: Neither user 10119 nor current process has android.permission.Internet

Build.Settings

settings = {    android =    {         usesPermissions = {           "android.permission.INTERNET",           "android.permission.WRITE\_EXTERNAL\_STORAGE",           "android.permission.ACCESS\_NETWORK\_STATE",           "android.permission.ACCESS\_FINE\_LOCATION",           "android.permission.ACCESS\_COARSE\_LOCATION",           "android.permission.READ\_PHONE\_STATE",         },         usesFeatures =         {             { name = "android.hardware.camera", required = false },             { name = "android.hardware.location", required = true },             { name = "android.hardware.location.gps", required = true },         },    }, }  

Logcat:

&nbsp; I/Corona&nbsp; ( 2057): Platform: SCH-I500 / ARM Neon / 2.3.5 / PowerVR SGX 540 / OpenGL ES 2.0 &nbsp; I/Corona&nbsp; ( 2057): name&nbsp;&nbsp;&nbsp;&nbsp;unknown &nbsp; V/Corona&nbsp; ( 2057): \> Class.forName: CoronaProvider.licensing.google.LuaLoader &nbsp; V/Corona&nbsp; ( 2057): \< Class.forName: CoronaProvider.licensing.google.LuaLoader &nbsp; V/Corona&nbsp; ( 2057): Loading via reflection: CoronaProvider.licensing.google.LuaLoader &nbsp; I/Corona&nbsp; ( 2057): name&nbsp;&nbsp;&nbsp;&nbsp;unknown &nbsp; I/Corona&nbsp; ( 2057): Runtime error &nbsp; I/Corona&nbsp; ( 2057): java.lang.SecurityException: Neither user 10119 nor current process has android.permission.INTERNET. &nbsp; I/Corona&nbsp; ( 2057): Java Stack Trace: &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;android.app.ContextImpl.enforce(ContextImpl.java:1440) &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1469) &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;android.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:395) &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;network.NetworkRequest.invoke(NetworkRequest.java:1961) &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;com.ansca.corona.JavaToNativeShim.nativeResize(Native Method) &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:316) &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:357) &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611) &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377) &nbsp; I/Corona&nbsp; ( 2057): stack traceback: &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;[C]: in function 'request' &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:283\> &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;?: in main chunk &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;[C]: in function 'require' &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:797\> &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;(tail call): ? &nbsp; I/Corona&nbsp; ( 2057): &nbsp;&nbsp;&nbsp;&nbsp;?: in main&nbsp;

This is the Request Fucntionat line 283

local downloadRemoteSettings = function() &nbsp;&nbsp;&nbsp;&nbsp;network.request( "http://infusedmiami.org/php/app/remoteSettings.php", "GET", getRemoteSettings) end data.downloadRemoteSettings = downloadRemoteSettings downloadRemoteSettings()

I’m going to suggest that you replace your build.settings (temporarily) with the build.settings from the GPS sample app and see if that solves the problem.

It looks like you are clearly adding the internet permission and I’ve never seen a situation that causes it not to load except for problems with the build.settings file.  Lets try to replace it with a known good one in case there are some hidden characters causing issues.

Rob

Rob,

Thank you for your guidance. I’ve built it with the build.settings file from the GPS sample app, and while it appears we’ve progressed slightly, the solution is not yet in sight.

Once I added the build.settings file from the GPS sample app, the Android device was recognizing the Coarse location permission. However, I still received the same internet permission error when the app opened. 

Can you try and build the GPS sample and see if it generates the same error?

Rob,

Thank you for your help, but it truly was a Newbie error. Once we took the iPhone settings out of the build.settings file it worked. We had assumed it would work with both the android and iphone settings instead–big mistake. Again, thank you for your help and patience. 

I’m going to suggest that you replace your build.settings (temporarily) with the build.settings from the GPS sample app and see if that solves the problem.

It looks like you are clearly adding the internet permission and I’ve never seen a situation that causes it not to load except for problems with the build.settings file.  Lets try to replace it with a known good one in case there are some hidden characters causing issues.

Rob

Rob,

Thank you for your guidance. I’ve built it with the build.settings file from the GPS sample app, and while it appears we’ve progressed slightly, the solution is not yet in sight.

Once I added the build.settings file from the GPS sample app, the Android device was recognizing the Coarse location permission. However, I still received the same internet permission error when the app opened. 

Can you try and build the GPS sample and see if it generates the same error?

Rob,

Thank you for your help, but it truly was a Newbie error. Once we took the iPhone settings out of the build.settings file it worked. We had assumed it would work with both the android and iphone settings instead–big mistake. Again, thank you for your help and patience.