Mapview Not Working In Corona Enterprise Build

HI,

 

Our app is using corona sdk map api to show the user location. It runs fine on android as well as iOS. But when we build the same app using corona enterprise for android, the spinner just keeps on spinning. It never shows the map in enterprise version. 

 

We have added

 

  <uses-permission android:name=“android.permission.ACCESS_FINE_LOCATION”/>

  <uses-permission android:name=“android.permission.ACCESS_COARSE_LOCATION”/>

  <uses-permission android:name=“android.permission.INTERNET”/>

 

 

  <uses-feature android:name=“android.hardware.location” android:required=“false”/>

  <uses-feature android:name=“android.hardware.location.gps” android:required=“false”/>

  <uses-feature android:name=“android.hardware.location.network” android:required=“false”/>

 

to the Manifest.xml. Any one has a solution to this, since it is high priority for the app.

Are you sure you placed the above uses-permission tags inside of the <manifest> tag and *not* inside of the <application> tag?

Also, it is very important that you reference the Corona Android library via the “project.properties” file so that your Android application project will automatically include Corona’s resource files.  This is important because Corona’s MapView requires its resource files in order to display the map.  All of our Corona Enterprise sample projects show an example of this.  You should *not* drag-and-drop the Corona.jar file into your Android application project’s “libs” directory.

I have followed every single step you have written.  Even i tried to implement enterprise version using the sample map Corona sdk has provided. Still the result is the same. Attached is the enterprise project template for android enterprise map view. Please give me the solution as this is an urgent req.

I have followed every single step you have written.  Even i tried to implement enterprise version using the sample map Corona sdk has provided. Still the result is the same. Attached is the enterprise project template for android enterprise map view. Please give me the solution as this is an urgent req.

I was able to reproduce this issue.  In turns out that the MapView only fails to load if an Android app project contains files within the “res” directory.  This is because Corona was fetching its map view HTML file by the R.java file’s resource ID when we should be fetching it by name like we do in the rest of our code.  (For your info, adding resources causes the Android generated R.java file to reshuffle its resource IDs, making it useless to Android library developers.)

This bug is now fixed.  The fix will be made available in daily build #1086.

Thank you for reporting this issue.

Hi When I tried to run the app with the version 1086, i got the following error in the console

I/Corona  ( 5599): ERROR: Could not load provider (google) due to the following reason: module ‘CoronaProvider.licensing.google’ not found:resource (CoronaProvider.licensing.google.lu) does not exist in archive

I/Corona  ( 5599):     no field package.preload[‘CoronaProvider.licensing.google’]

I/Corona  ( 5599):     no file ‘(null)/CoronaProvider.licensing.google.lua’

I/Corona  ( 5599):     no file ‘(null)/CoronaProvider.licensing.google.lua’

Could you please tell me how to fix this

Oh… yeah, our recent Google Expansion File support that we’ve added is the cause of that.  We just caught that issue ourselves this morning as well.  We’ll fix that issue in the next daily build.

@joshua I’ve got that CoronaProvider.licensing.google error using Build 1087, so it’s not fixed yet right?

This is only an issue for Corona Enterprise builds as of daily build #1082.

We’ll have a fix for this issue in daily build #1088.

HI

I tried my app on the latest build(1088). The current issue which i had experience in build (1084) is that the json values returned from the server are not readable while it was ok in the old builds (e.g.: build 1035). Could you please check what happened later .

Karim,

I don’t understand what you mean.  What exactly is not working?  Are you referring to our network API in Lua?  Can you post a code example please?  Thanks.

Our application uses the following code which returns json data, which is decoded and used through out the application. It works fine with corona sdk as well as Corona Enterprise 1035 build. But when we tried to use the latest builds of corona enterprise (1088) to use the map update, we faced another issue. The values returned by the network request are not readable. Below is the code which returns the json values. But the return values  are not readable. Please take this as high  priority.                                                                                                     

 

 

 

local json = require(“json”)   

 

 

local params = {}  – request parameter dict

 

    – add to incoming parameters    

    parameters[“deviceId”] = “f0a11e205e8ab881561f3d408fbef2ca6b0ce04e”

    parameters[“apiKey”] = API_KEY

    local request_dict = {}

    

    request_dict[“method”] = methodname

    request_dict[“id”] = “1”

    request_dict[“jsonrpc”] = “2.0”

    request_dict[“params”] = parameters

    params.body = json.encode( request_dict )

    local headers = {}

    headers[“Accept”] = “application/json”

    headers[“Content-Type”] = “application/x-www-form-urlencoded”

    headers[“Accept-Encoding”] = “gzip”

    headers[“Content-Length”] = string.len( params.body )

 

    params.headers = headers

    

 

    --== Create Request Callback

 

    local callback = function( event )

        local mr_params = {

                    command = methodname,

                    parameters = parameters,

                    successHandler = successHandler,

                    errorHandler = errorHandler

                }

 

        self:_makeRequest_handler( event, mr_params )

    end

    

    network.request( url, “POST”, callback, params )

HI, I tested my app on enterprise build no: 1092 and 1093, I got this exception on android while running a callback.

com.naef.jnlua.LuaRuntimeException: ?:0: attempt to index a nil value

at com.naef.jnlua.LuaState.lua_pcall(Native Method)

at com.naef.jnlua.LuaState.call(Unknown Source)

at com.ansca.corona.CoronaLua.dispatchEvent(CoronaLua.java:90)

at network.NetworkRequest$LuaCallback$1.executeUsing(NetworkRequest.java:598)

at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:153)

at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:274)

at com.ansca.corona.Controller.onDrawFrame(Controller.java:233)

at com.ansca.corona.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:379)

at com.ansca.corona.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1622)

at com.ansca.corona.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

Could you please take it as high priority since we need to release the app this weekend.

Karim,

The following runtime error in your log indicates that there is a bug in your Lua script.  It means you are trying to access a Lua object that doesn’t exist (ie: it is nil).

>> com.naef.jnlua.LuaRuntimeException: ?:0: attempt to index a nil value

If your Lua script does not contain any custom Lua functions that you’ve added via Corona Enterprise, then you can use the Corona Simulator with to find which Lua file and line number this error is occurring on.  The Corona Terminal will log the error.

If you cannot use the Corona Simulator, then unfortunately you are going to have to debug this the old school way and add print() statements within your code to find where the error is occurring.  Odds are your Lua runtime error is inside of your network listener.

Now, we did make a breaking changing in our network API where “event.response” will be a table, not a string, if you are downloading/uploading a file.

One more thing.  You should not set the “Accept-Encoding” to “gzip” because Corona will not automatically decompress the received response.  Android will not do this automatically on Android 2.x devices either, but supposedly they do with Android 3.0 and higher OS versions.  My recommendation is to set “Accept-Encoding” to an empty string, which tells the server to not encode the response.

Anyways, I hope this helps.

Are you sure you placed the above uses-permission tags inside of the <manifest> tag and *not* inside of the <application> tag?

Also, it is very important that you reference the Corona Android library via the “project.properties” file so that your Android application project will automatically include Corona’s resource files.  This is important because Corona’s MapView requires its resource files in order to display the map.  All of our Corona Enterprise sample projects show an example of this.  You should *not* drag-and-drop the Corona.jar file into your Android application project’s “libs” directory.

I have followed every single step you have written.  Even i tried to implement enterprise version using the sample map Corona sdk has provided. Still the result is the same. Attached is the enterprise project template for android enterprise map view. Please give me the solution as this is an urgent req.

I have followed every single step you have written.  Even i tried to implement enterprise version using the sample map Corona sdk has provided. Still the result is the same. Attached is the enterprise project template for android enterprise map view. Please give me the solution as this is an urgent req.

Thanks a lot for the inputs … It looks fine now with1093 Build

I was able to reproduce this issue.  In turns out that the MapView only fails to load if an Android app project contains files within the “res” directory.  This is because Corona was fetching its map view HTML file by the R.java file’s resource ID when we should be fetching it by name like we do in the rest of our code.  (For your info, adding resources causes the Android generated R.java file to reshuffle its resource IDs, making it useless to Android library developers.)

This bug is now fixed.  The fix will be made available in daily build #1086.

Thank you for reporting this issue.

Hi When I tried to run the app with the version 1086, i got the following error in the console

I/Corona  ( 5599): ERROR: Could not load provider (google) due to the following reason: module ‘CoronaProvider.licensing.google’ not found:resource (CoronaProvider.licensing.google.lu) does not exist in archive

I/Corona  ( 5599):     no field package.preload[‘CoronaProvider.licensing.google’]

I/Corona  ( 5599):     no file ‘(null)/CoronaProvider.licensing.google.lua’

I/Corona  ( 5599):     no file ‘(null)/CoronaProvider.licensing.google.lua’

Could you please tell me how to fix this