ApkBuilder - INVALID alert

169 views
Skip to first unread message

Gloglas´s Studio

unread,
Nov 20, 2021, 6:26:15 PM11/20/21
to DroidScript
Hi,
I have problem while Building APK.
When I click 'OK' to build it will show the progress bar.
After that it will show dialog "App created in folder /Droidscript/APKs, Install now?".
And when I click yes it opens dialog "INVALID".
I cannot find any files in /storage/emulated/0/Android/data/com.smartphoneremote.androidscriptfree
/storage/emulated/0/Android/data/
/storage/emulated/0/DroidScript/
Even the APKs folder didn't showed up.

I have bought APK builder and I installed it with: https://groups.google.com/g/androidscript/c/Ed-z8wTQqZU/m/Zi0nSe9CEQAJ

Dave

unread,
Nov 24, 2021, 3:24:58 PM11/24/21
to DroidScript
This usually means that you are trying to install an APK with a different signature over an existing APK.  Try uninstalling the target APK first.

Gloglas´s Studio

unread,
Dec 2, 2021, 7:52:57 AM12/2/21
to DroidScript
That is the problem. I haven't installed it yet. And there are no collisions. And the .apk is nowhere to be found.

Dne středa 24. listopadu 2021 v 21:24:58 UTC+1 uživatel Dave napsal:

Steve Garman

unread,
Dec 2, 2021, 8:15:45 AM12/2/21
to DroidScript
Let's see if we can find the .apk file first
Try running the code below in DroidScript and see if it shows your apk

///////////////////////////
function OnStart()
{
   lay = app.CreateLayout("linear", "VCenter, FillXY")
   txt = app.AddTextEdit(lay, "Waiting")
   app.AddLayout(lay)
   var arr = app.ListFolder("/Storage/DroidScript/APKs")
   txt.SetText(arr.join("\n"))

Gloglas´s Studio

unread,
Dec 2, 2021, 8:31:52 AM12/2/21
to DroidScript
Ok it is there but I cant find it in fileexplorer.

Dne čtvrtek 2. prosince 2021 v 14:15:45 UTC+1 uživatel steve....@gmail.com napsal:

Steve Garman

unread,
Dec 2, 2021, 8:41:10 AM12/2/21
to DroidScript
What version of DroidScript are you using and what  version of apkbuilder plugin

Try this code instead to get the path to your apk
IWhat is its address?

///////////////////////////
function OnStart()
{
   lay = app.CreateLayout("linear", "VCenter, FillXY")
   lst = app.AddList(lay, "Waiting")
   lst.SetOnTouch( lst_OnTouch )
   app.AddLayout(lay)
   var arr = app.ListFolder(
     "/Storage/DroidScript/APKs",null,null,"fullPath")
   lst.SetList(arr)
}
function lst_OnTouch(title)
{
app.SetClipboardText( title )
app.Quit( "Copied yo clipboard", title )

Gloglas´s Studio

unread,
Dec 4, 2021, 6:55:14 PM12/4/21
to DroidScript
I am using http://androidscript.org/apk/DroidScript_209/
The keystore prompt displayed after I plugged the phone in computer and tryied to build it for xth time. 
I found out that scoped storage is even for system filemanager app. So I found a APK in  ...data/com.smartphoneremote.androidscriptfree/... but it didn't work (few kB).
So I deleted it. When I build apk it throws a INVALID message. But when I try my temp project it compiles OK.
The temp project APK didn't show up in ../Android/data/com.smartphoneremote.androidscriptfree... (Which i discovered that was a stupid filesystem/windows error).

My conclusion is that when I use name like "Čert" and have "Čert.png" as my icon. The apk builder throws INVALID error.
Dne čtvrtek 2. prosince 2021 v 14:41:10 UTC+1 uživatel steve....@gmail.com napsal:

Gloglas´s Studio

unread,
Dec 13, 2021, 1:23:00 AM12/13/21
to DroidScript
Will there be a fix so I can again build APKs with icon and name that includes čřžšě?

Dne neděle 5. prosince 2021 v 0:55:14 UTC+1 uživatel Gloglas´s Studio napsal:

Steve Garman

unread,
Dec 13, 2021, 3:24:02 AM12/13/21
to DroidScript
I'm surprised to hear you have ever been able to build APKs with files with that sort of name

I agree that it's something that needs fixing but last I heard it is a much bigger job than you would think, involving replacing some standard components with others that are not 100% compatible with those currently in use
This runs the risk of introducing new subtle errors into the build process

I recommend for now that you only use simple file names (preferably ASCII) in any apps from which you wish to build APKs or AABs

I'm afraid you will probably find it less frustrating to change the file names (and search/replace the references to them) in your existing code than to wait for a fix that is not guaranteed to arrive soon

Gloglas´s Studio

unread,
Dec 14, 2021, 6:26:47 PM12/14/21
to DroidScript
Can I somehow use these characters in name and still get a icon? Do something like a hardlink?

Dne pondělí 13. prosince 2021 v 9:24:02 UTC+1 uživatel steve....@gmail.com napsal:

Steve Garman

unread,
Dec 15, 2021, 5:21:58 AM12/15/21
to DroidScript
I am not aware of any workaround to this issue

The problem only applies to file names, which is not something a user of your app would normally see.
It should only affect files embeded in your code. Extra files downloaded at runtime should work wihether they have simple filenames or not

I realise it may be irritating to have to  make the changes needed but, once done, it should not have any effect on the working or appearance of your app

If you  have specific concerns about using different file names, please post them here and someone may be able to help or reassure you

If I were doing this I would make a copy of the original app in DroidScript using the "Copy" action from the main DroidScript menu, in case something went wrong

Then in the original code I would search and replace one file name in the code
Then I would rename the file or, if easier, copy it  and delete the original
Then I would run the code in DroidScript to make sure it still works before moving on to do the next file
Reply all
Reply to author
Forward
0 new messages