Release build problems

I’ve been using the Corona SDK to develop an app for Android.  I’ve been building it using the debug keystore and then copying the .apk file over to my Galaxy S3 for testing.

My app has run error free over the past few months, but today I tried testing a release version and it locks up when loading.

I was not aware just changing form a debug keystore to a release keystore could cause errors in an app.

Any help on where to start looking for the problem would be much appreciated.

Are there any messages in your device’s console log?

Need help with that?  See: http://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

On a hunch, I commented out reading from and writing to my high score file and my game runs fine (except I can’t save score, of course).

At least I know where to begin.

Thanks for the link, it seems I’m about to enter the world of debugging on Android devices :slight_smile:

Rob, I used you sample code to save my high score and it’s definitely the problem.

Are there some build settings I need to set so Android devices allow your save high score example code to work?

Thanks

Can you post your build.settings?

settings = 

{

    android =

    {

        usesPermissions =

        { 

            “android.permission.READ_EXTERNAL_STORAGE”,

            “android.permission.WRITE_EXTERNAL_STORAGE”,

        },

    },

}

I may have fixed my problem.

One of the first things I do is call score.load() and set the current level to it(I’m using your high score code to actually save which level a player is on).

The first time the game runs, it’s possible score.load() is returning a bad value I did properly guard against before.

I’ve added some more code to guard against getting a bad value for level and it now works fine on the first couple Android devices I’ve tested it on.

Anyhoo,

Thanks for the help(and the sample code)

If you call score.load() and there isn’t a score to load, it should return nil, and this is a condition you should test for.   Likely changing the keystore caused a new sandbox to be created, meaning your saved files were not there.

Rob

Are there any messages in your device’s console log?

Need help with that?  See: http://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

On a hunch, I commented out reading from and writing to my high score file and my game runs fine (except I can’t save score, of course).

At least I know where to begin.

Thanks for the link, it seems I’m about to enter the world of debugging on Android devices :slight_smile:

Rob, I used you sample code to save my high score and it’s definitely the problem.

Are there some build settings I need to set so Android devices allow your save high score example code to work?

Thanks

Can you post your build.settings?

settings = 

{

    android =

    {

        usesPermissions =

        { 

            “android.permission.READ_EXTERNAL_STORAGE”,

            “android.permission.WRITE_EXTERNAL_STORAGE”,

        },

    },

}

I may have fixed my problem.

One of the first things I do is call score.load() and set the current level to it(I’m using your high score code to actually save which level a player is on).

The first time the game runs, it’s possible score.load() is returning a bad value I did properly guard against before.

I’ve added some more code to guard against getting a bad value for level and it now works fine on the first couple Android devices I’ve tested it on.

Anyhoo,

Thanks for the help(and the sample code)

If you call score.load() and there isn’t a score to load, it should return nil, and this is a condition you should test for.   Likely changing the keystore caused a new sandbox to be created, meaning your saved files were not there.

Rob