use previous Obb file ExpansionFile reference

I know I’ve been flooding with questions lately, but I think I am near finish line with Android. So I have a pretty large expansion file and I wouldn’t want users to download the whole new obb file if I make changes in the apk. The problem is google requires a new/higher version of the updated app and if I create that with corona, a new obb file is created with a new name.

You have the ability to choose old expension file on the Play console and it all looks ok, the apk is downloaded and the obb file gets downloaded after that, but the app is not working after the launch image even after all is downloaded. I suspect it is because internaly Corona is referencing the new obb file. Am I thinking right or is there something else I am doing wrong? If I upload same versions of apk and obb it works. Would love to get a response on this.

I am running in circles here. based on the info on the old tutorial: https://coronalabs.com/blog/2013/04/17/expansion-file-support-for-android/

"What if I updated my APK without updating my expansion file? Guess I’ll need to update my code to use the correct expansion files." 

I would asume that it should work automaticaly…But I am not sure if I should add some extra code or smth, since previous obb versions are just not working for me. I have tested so many options now I even received a warning in play console that the new obb file is similiar to the old one. Anyhow I thought maybe the google key was to blame in config.lua  since I did not yet enroll in  Enroll your app in Google Play App Signing - I am not even sure if I should enroll and how Corona would handle step nr4 in App Signing proces. But the app with same obb file works just fine with this key. If anyone can please confirm that this is in fact not working or point me on the right track, I would really apreciate it.

It’s been almost a week, can someone please tell me if using old expansion files are working now or not and if they do, how? 

I’ll see if I can get more information on expansion files.

On Google App Signing. I believe it will work with Corona apps, but I only know of one test case. It’s best to opt-out and stay with the current app signing method for now.

Rob

I would like to point out that you need to read that blog post carefully. Corona does almost all the work for you. There is a section where you pulled that quote from was prefixed by this:

" If you had to write your application natively in Java , then there are a lot of situations you have have to think about before you can even start your application."

You don’t need to think about those things. We were showing you how much expansion file work Corona does for you behind the scenes.

Rob

yes, Rob I got that. But it’s not working for me and I would just like some feedback if I’m doing smth wrong on my part or is this a corona issue. Since Corona really does most / all the work with the obb file, I really don’t think it’s smth on my part.

My suggestion is to plug your device into your USB port and use “adb logcat” and look for errors. If you’re OBB file isn’t different and Google lets you use an existing OBB file, then we should be okay with that.

Rob

I am sorry, but I’ve never done “adb logcat” so I need a little more asistance here.

I have a beta version now that uses the same OBB file as the apk file. If I understand your suggestion, I should build a brand new version and use previous OBB file on google play store, download the new apk on device, plug it to mac via USB and run “adb logcat” on terminal. Is that right? 

This guide might help.

https://docs.coronalabs.com/guide/basics/debugging/index.html

Hi, Rob

i finally managed to get the adb logcat corona from device. Can I send someone the log file to have a look at it? Everything but using previous obb files is working great on Android for me now. Thanks

You can post it here.

so this is what I got when I ran the app on device with previous obb file set up on google play store. It didn’t work past the launch screen.

--------- beginning of system--------- beginning of main V/Corona &nbsp;(30133): \> Class.forName: network.LuaLoader V/Corona &nbsp;(30133): \< Class.forName: network.LuaLoader V/Corona &nbsp;(30133): Loading via reflection: network.LuaLoader I/Corona &nbsp;(30133): Platform: LG-K120 / ARM Neon / 5.1.1 / Mali-T720 / OpenGL ES 3.1 / 2017.3158 / V/Corona &nbsp;(30133): \> Class.forName: shared.google.play.services.base.LuaLoader V/Corona &nbsp;(30133): \< Class.forName: shared.google.play.services.base.LuaLoader V/Corona &nbsp;(30133): Loading via reflection: shared.google.play.services.base.LuaLoader V/Corona &nbsp;(30133): \> Class.forName: \_CoronaSetup.LuaLoader V/Corona &nbsp;(30133): \> Class.forName: plugin.googleAnalytics.LuaLoader V/Corona &nbsp;(30133): \< Class.forName: plugin.googleAnalytics.LuaLoader V/Corona &nbsp;(30133): Loading via reflection: plugin.googleAnalytics.LuaLoader I/Corona &nbsp;(30133): WARNING: audio.loadSound() failed to create sound 'audio/tada.mp3' I/Corona &nbsp;(30133): WARNING: Failed to find image 'images/bg\_stars.jpg' I/Corona &nbsp;(30133): ERROR: Runtime error I/Corona &nbsp;(30133): ?:0: attempt to index field 'bg\_stars' (a nil value) I/Corona &nbsp;(30133): stack traceback: I/Corona &nbsp;(30133): ?: in function 'method' I/Corona &nbsp;(30133): /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:221: in function 'dispatchEvent' I/Corona &nbsp;(30133): /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/composer/composer.lua:1470: in function 'gotoScene' I/Corona &nbsp;(30133): ?: in function \<?:122\> I/Corona &nbsp;(30133): ?: in main chunk V/Corona &nbsp;(30133): \> Class.forName: CoronaProvider.licensing.google.LuaLoader V/Corona &nbsp;(30133): \< Class.forName: CoronaProvider.licensing.google.LuaLoader V/Corona &nbsp;(30133): Loading via reflection: CoronaProvider.licensing.google.LuaLoader E/Corona &nbsp;(30133): Invalid public key E/Corona &nbsp;(30133): java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1\_get\_object:header too long E/Corona &nbsp;(30133): at com.google.android.vending.licensing.LicenseChecker.generatePublicKey(LicenseChecker.java:121) E/Corona &nbsp;(30133): at com.google.android.vending.licensing.LicenseChecker.\<init\>(LicenseChecker.java:92) E/Corona &nbsp;(30133): at CoronaProvider.licensing.google.LuaLoader.initLicenseChecker(LuaLoader.java:174) E/Corona &nbsp;(30133): at CoronaProvider.licensing.google.LuaLoader.init(LuaLoader.java:144) E/Corona &nbsp;(30133): at CoronaProvider.licensing.google.LuaLoader$InitWrapper.invoke(LuaLoader.java:421) E/Corona &nbsp;(30133): at com.naef.jnlua.LuaState.lua\_pcall(Native Method) E/Corona &nbsp;(30133): at com.naef.jnlua.LuaState.call(Unknown Source) E/Corona &nbsp;(30133): at com.ansca.corona.CoronaLua.dispatchEvent(CoronaLua.java:138) E/Corona &nbsp;(30133): at shared.google.play.services.base.SharedGooglePlayServicesBaseEvent.executeUsing(SharedGooglePlayServicesBaseEvent.java:27) E/Corona &nbsp;(30133): at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:170) E/Corona &nbsp;(30133): at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:91) E/Corona &nbsp;(30133): at com.ansca.corona.Controller.updateRuntimeState(Controller.java:308) E/Corona &nbsp;(30133): at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421) E/Corona &nbsp;(30133): at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623) E/Corona &nbsp;(30133): at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378) E/Corona &nbsp;(30133): Caused by: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1\_get\_object:header too long E/Corona &nbsp;(30133): at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:155) E/Corona &nbsp;(30133): at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:47) E/Corona &nbsp;(30133): at java.security.KeyFactory.generatePublic(KeyFactory.java:172) E/Corona &nbsp;(30133): at com.google.android.vending.licensing.LicenseChecker.generatePublicKey(LicenseChecker.java:112) E/Corona &nbsp;(30133): ... 14 more E/Corona &nbsp;(30133): Caused by: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1\_get\_object:header too long E/Corona &nbsp;(30133): at com.android.org.conscrypt.NativeCrypto.d2i\_PUBKEY(Native Method) E/Corona &nbsp;(30133): at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:153) E/Corona &nbsp;(30133): ... 17 more

Those messages tend to tell me it’s not finding the obb file, which I think we knew. Can you run it again with just:

“adb logcat”

It will create a lot of noise, but it will get errors from things other than your Corona app which is were the errors we are looking from are probably coming from.

Rob

Hi Rob, got the same problem here.

The scenario are:

  1. If I use same APK version and OBB version in the google console, the download will be fine and the app works great.
  2. If I use new APK version, without giving new OBB file (no asset changed in the new build), the download will be fine, it seems downloading an OBB file too (because of its large download, we have 600MB file here), but the app cannot run because missing asset.

The things I want to ask you are:

  1. Whether I should always upload the new OBB along with the new APK, even there is no change in the asset (only code changes).
  2. Could I only build the apk file without generating the OBB file (using excludeFiles mechanism, and removing the “usesExpansionFile = true” statement in the build.settings file, then the App still work by using the old OBB?

Notes:

  • I already succeeded using expansion files with Corona by using the same version of APK and OBB.
  • Our OBB files is very big (> 500MB in size), so I wish not to upload and update the OBB files for each APK update.

If anyone see this and has some ideas of how it should be done, or something wrong with my assumption, please point it out!
Thanks!

Haudy

I am about to roll an update and this is still an unresolved issue for me. Orcastelov, did you solve anything?

I have pinged Engineering to see if I can get some advice on this. It is the weekend, so I’m not sure if we will get an answer for a couple of days.

Rob

Hi odisej, I ended up upload the big obb each time I give an update, even when there is no asset change in the obb. The new big obb should always has same version number with the update apk.

Hi, Rob I’m using this forum a lot today and am just giving you a little nudge on this issue. It is rather annoying to upload large files on google play every time you make a small change in a code. Not to mention, you can loose users if a large app is updated to many times.

I’ll prod our engineers again.  

Well, my update is ready, fixed a few issues and added some features, alas no previous obb file support:(