Install apk on android device with obb file

Hi,

I’m building a game that already run on ios devices and now I want to install it on android device.

I’m trying to install my app on android device and because my app is large than 50mb 

the corona split it into apk and obb files.

I copied the both of files into my device and put the obb file under “sdcard/Android/obb/myPackagefolder” folder,

then I launch and install the apk.

now - when i’m trying to open my  application it open the download page to try download the

data (obb) from google play and doesn’t recognize the file I already put into the obb’s folder.

my build.settings contains the permission  “WRITE_EXTERNAL_STORAGE”

my Q: is it even possible to do that ? and what I miss that cause my problem?

please help me, I spend a lot of time on it…

thanks 

Hi eder,

There are some known issues with Expansion File support where Corona will give false positives as to what’s currently happening with your Expansion Files.

If you don’t manually put anything in the aforementioned directory, does your app still download the expansion file and launch correctly?

Hi Ajay, thanks for replying ,

The application behaves the same if I don’t put the expansion file manually, it opens the download screen and try to download it from the internet, (of course there is no obb file on the Internet I’m just trying to debug my application)
Additionally I noticed that on app info in android device settings where it shows the size of the application, it include the bob file size when the bob file is on the correct place, I mean that it seems that the application know about this file but not load it while it runing.

For testing purposes, you should upload an alpha version of your app to Google Play Dev Console and test out the full behavior of your app. This is the process that your users would go through so testing that from the get-go would be my recommendation.

thanks,

It sounds  wierd that just for run my application on android device I must upload it to the googlePlay,

must to be way to run it on the device without this long process.

any-way, thanks for helping!

I agree that it’s not ideal, but you’d have to upload your app to Google Play (assuming you plan to release it) anyway.

Fortunately, you’ll only need to upload a new version of your app when you make changes to the contents of your Expansion Files. So that’s slightly less headache with Google Play.

Slight correction of my previous comment, you have to upload a version of your app with expansion file to Google Play, but after you do that, you _ can _ continue to iterate on the content of your Expansion File by side-loading it. Just be sure that you build your app with the _ correct package name and version code _ you provided to Google Play.

When a Corona app that uses Expansion Files launches, the engine will use Google Licensing to verify your package owns the Expansion File and some properties of the Expansion File itself. This is why you need to do an initial upload to Google Play.

In regards to testing Expansion Files, be sure to put the .obb file in the correct place. Unfortunately, this can vary between devices. There are a couple ways you can verify what location Expansion Files should go to.

  1. Using the Android “Monitor” tool’s “File Explorer”, you can see where the obb directory is.
  2. Download a free app that’s over 100MB and see where the Expansion File gets downloaded.

For example, on Nexus devices, you should put the .obb file in this directory.

/mnt/shell/emulated/obb/\<my.package.name\>/\<my.obb.file\>

However, for Samsung devices, the directory would be different.

When you’ve got your app ready to ship, at that point you should be sure to upload the final Expansion File to Google Play.

if you can don’t use obb files and simply download extra content via your server (assuming you have one).  Google play now supports apks up to 100MB

thanks,

I uploaded the app to google play

now I get new error when the application try download the data:

 java.lang.RuntimeException: ERROR: table expected. If this is a function call, you might have used ‘.’ instead of ‘:’

    stack traceback:

    [C]: ?

    [C]: in function ‘insert’

    ?: in function ‘addImageSheetToParent’

    ?: in function ‘addImageSheetImage’

    ?: in function ‘newImage’

    ?: in function ‘method’

    /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:234: in function ‘dispatchEvent’

    /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:886: in function </Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:865>

    (tail call): ?

    /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/transition/transition.lua:582: in function ‘method’

    /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:234: in function </Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:205>

 

 

after long search I didn’t find a solution for this, 

any idea ?

 

thanks

check you are using   **obj:insert()  **and not  obj.insert().

I have a lot of insertions in my project and the application is running with no problem on the simulator

and on iOS device, the error happens on android device only.

I tried to check all my :insert() in my code and all of them  on a group…

how can I know more specifically details on this error?

First check for case-sensitivity on your image paths.  The emulator is not case-sensitive, Android is.

Build your app using the debug keystore when testing on device to ensure you get line numbers in debug messages (assuming the error is in your code and not runtime lua).

Hi eder,

There are some known issues with Expansion File support where Corona will give false positives as to what’s currently happening with your Expansion Files.

If you don’t manually put anything in the aforementioned directory, does your app still download the expansion file and launch correctly?

Hi Ajay, thanks for replying ,

The application behaves the same if I don’t put the expansion file manually, it opens the download screen and try to download it from the internet, (of course there is no obb file on the Internet I’m just trying to debug my application)
Additionally I noticed that on app info in android device settings where it shows the size of the application, it include the bob file size when the bob file is on the correct place, I mean that it seems that the application know about this file but not load it while it runing.

For testing purposes, you should upload an alpha version of your app to Google Play Dev Console and test out the full behavior of your app. This is the process that your users would go through so testing that from the get-go would be my recommendation.

thanks,

It sounds  wierd that just for run my application on android device I must upload it to the googlePlay,

must to be way to run it on the device without this long process.

any-way, thanks for helping!

I agree that it’s not ideal, but you’d have to upload your app to Google Play (assuming you plan to release it) anyway.

Fortunately, you’ll only need to upload a new version of your app when you make changes to the contents of your Expansion Files. So that’s slightly less headache with Google Play.

Slight correction of my previous comment, you have to upload a version of your app with expansion file to Google Play, but after you do that, you _ can _ continue to iterate on the content of your Expansion File by side-loading it. Just be sure that you build your app with the _ correct package name and version code _ you provided to Google Play.

When a Corona app that uses Expansion Files launches, the engine will use Google Licensing to verify your package owns the Expansion File and some properties of the Expansion File itself. This is why you need to do an initial upload to Google Play.

In regards to testing Expansion Files, be sure to put the .obb file in the correct place. Unfortunately, this can vary between devices. There are a couple ways you can verify what location Expansion Files should go to.

  1. Using the Android “Monitor” tool’s “File Explorer”, you can see where the obb directory is.
  2. Download a free app that’s over 100MB and see where the Expansion File gets downloaded.

For example, on Nexus devices, you should put the .obb file in this directory.

/mnt/shell/emulated/obb/\<my.package.name\>/\<my.obb.file\>

However, for Samsung devices, the directory would be different.

When you’ve got your app ready to ship, at that point you should be sure to upload the final Expansion File to Google Play.

if you can don’t use obb files and simply download extra content via your server (assuming you have one).  Google play now supports apks up to 100MB

thanks,

I uploaded the app to google play

now I get new error when the application try download the data:

 java.lang.RuntimeException: ERROR: table expected. If this is a function call, you might have used ‘.’ instead of ‘:’

    stack traceback:

    [C]: ?

    [C]: in function ‘insert’

    ?: in function ‘addImageSheetToParent’

    ?: in function ‘addImageSheetImage’

    ?: in function ‘newImage’

    ?: in function ‘method’

    /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:234: in function ‘dispatchEvent’

    /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:886: in function </Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:865>

    (tail call): ?

    /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/transition/transition.lua:582: in function ‘method’

    /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:234: in function </Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:205>

 

 

after long search I didn’t find a solution for this, 

any idea ?

 

thanks

check you are using   **obj:insert()  **and not  obj.insert().

I have a lot of insertions in my project and the application is running with no problem on the simulator

and on iOS device, the error happens on android device only.

I tried to check all my :insert() in my code and all of them  on a group…

how can I know more specifically details on this error?