Build.json settings for apk on playstore

296 views
Skip to first unread message

Nii Darko Darkoh

unread,
Jun 6, 2021, 2:58:42 AM6/6/21
to DroidScript

Hi DS, 

I need to create a build.json file to execute the FF restrictions for my apk to the playstore; 
1. Set minimum Android version (minSdkVersion) to 7.
2. What API Level (targetSdkVersion) should I set if my minimum Android version is 7 ?
3. Remove permission for READ_PHONE_STATE

Please inspect my build.json file below and tell if it's safe to deploy to playstore.

{
"manifest" : 
"minSdkVersion" : 7,
"targetSdkVersion" : 24,
"removePermissions" : "READ_PHONE_STATE"
}
}

kindly explain to me the meaning of the  minSdkVersion and targetSdkVersion and the correct values to assign to them.

Thank you.

Steve Garman

unread,
Jun 6, 2021, 4:46:29 AM6/6/21
to DroidScript
If all you are trying to do is to implement Alan's suggestion about removing a permission I recommend you use as minimal a build.json file as possible. 

{
  "manifest": {
    "removePermissions": "READ_PHONE_STATE"
  }
}

If you are using a recent version of DroidScript it will use sensible default values for the rest.

I assume your app uses  app.Call() or app.CreatePhoneState() so removePermission may some of the functionality of your app.

Make sure you build your apk, install it and test any phone functionality thoroughly before uploading to Google Play.

You can ignore the rest of this post unless you have a pressing reason to set sdkVersions in your file

The value you suggested for 
"targetSdkVersion" : 24
would not be accepted by Google, the only sensible value at the moment is 29 but if you hardcode a value into your build.json file you are just storing up problems for future releases

"minSdkVersion" : 7 
refers to a very old version of Android 2.1.x (ECLAIR_MR1) that DroidScript does not support

To see the different api levels available just for interest you could look at

Steve Garman

unread,
Jun 6, 2021, 5:34:28 AM6/6/21
to DroidScript
Please do not send me private emails unless I ask for them.
I usually do not see them unless I am expecting them and if I do stumble across them it is not at a time when I am set up to reply.

The bulid.json file goes in the top lever folder of your project.
The same folder where your main .js or .html file exists

Nii Darko Darkoh

unread,
Jun 6, 2021, 5:41:59 AM6/6/21
to DroidScript
Thanks a lot.

Nii Darko Darkoh

unread,
Jun 6, 2021, 6:29:42 PM6/6/21
to DroidScript
Hi, 
When I included the build.json into my apk packaging
I get an error that says " Package file is corrupt ". The error actually came
up when I was installing.

So I did a new package without the build.json file and the apk installed successfully.
What did I do wrong?

Steve Garman

unread,
Jun 6, 2021, 6:33:17 PM6/6/21
to DroidScript
attach here the actual build.json file you added to your project and we'll take a look at it
Message has been deleted

Nii Darko Darkoh

unread,
Jun 6, 2021, 11:39:23 PM6/6/21
to DroidScript
Hi,
file is attached please.
I am delighted to relate that my apk upload to playstore console has successfully gone through.
Thanks to all.
build.json
Reply all
Reply to author
Forward
Message has been deleted
0 new messages