Sketchware-Pro / Sketchware-Pro

Sketchware Pro's sources in Java. Now anyone can contribute to Sketchware Pro.
https://sketchware.pro
Other
863 stars 254 forks source link

Package install error #684

Open devkumar00001 opened 1 year ago

devkumar00001 commented 1 year ago

I used to create app and sign it from sketchware but when v6.4.0rc-05 miniApi 26 my app is run good but it is not signing I am sketchware sign my apk but the apk is not installing. In old version(v6.4.0rc-04 miniApi 26) the apk is installing with no problem please guide me to fix it or if it is a bug please try to fix it.

devkumar00001 commented 1 year ago

And due to this reason I can't able to ad my admob real data

JavkhlanK commented 1 year ago

When exporting an APK, zipalign gets run to optimize the APK file. Somehow that currently ends up corrupting the signature though. To fix that, sign the .apk again with e.g. apk-signer.

devkumar00001 commented 1 year ago

When exporting an APK, zipalign gets run to optimize the APK file. Somehow that currently ends up corrupting the signature though. To fix that, sign the .apk again with e.g. apk-signer.

Can you give a advice in briefly how Can I currently fix the error currently because my app is live on Amazon app store and I have to update it with same signature

JavkhlanK commented 1 year ago

To fix that, sign the .apk again with e.g. apk-signer.

devkumar00001 commented 1 year ago

To fix that, sign the .apk again with e.g. apk-signer.

I already did it but Ii can't fix😣😣😣

JavkhlanK commented 1 year ago

what?

devkumar00001 commented 1 year ago

what?

I have already tried it but it is not fixing

devkumar00001 commented 1 year ago

IMG_20221229_153134

devkumar00001 commented 1 year ago

This is my app : https://www.amazon.com/dp/B09PZVR7L7/ref=apps_sf_sta I have published this app to take admob approval for ads and Admob approved my app to serve ads but when I entered my admob data to sketchware pro and then run it,It shows me test and then someone taught me you need to sign apk from sketchware to show real ads.So I did same,But sketchware-pro is not correctly signing my apk my device show There was a problem while parsing the package I tried apk-signer as you(JavkhlanK ) suggested me but apk-signer is also crashed https://github.com/Sketchware-Pro/Sketchware-Pro/issues/684#issuecomment-1367206753. Please suggest me another way to fix it as I have no option now to add admob real ads

JavkhlanK commented 1 year ago

Did you turn on aligning in apk-signer? If yes, try turning that off.

devkumar00001 commented 1 year ago

Did you turn on aligning in apk-signer? If yes, try turning that off.

I tried both but did not working.

devkumar00001 commented 1 year ago

@JavkhlanK I found a way to fix admob problem I replaced test id's to my real id's using XML and Java command block.

JavkhlanK commented 1 year ago

Don't publish .apk files generated by the Run button. They should only be used for testing.

devkumar00001 commented 1 year ago

Don't publish .apk files generated by the Run button. They should only be used for testing.

Thanks for your information but why?

JavkhlanK commented 1 year ago

They contain debug code, like test ad IDs or the debug logcat logger. There might even be more, but those .apk files just aren't meant to be shared with others.

devkumar00001 commented 1 year ago

Ok but there is any hope to fix that?

subhash16 commented 1 year ago

First you have edit the apk file with the help of apk editor ,just change anything like minimum SDK 20 then build the apk and sign the exported apk with apk signer it will work definitely.

JavkhlanK commented 1 year ago

Ok but there is any hope to fix that?

Seems like an issue in apk-signer, I don't know. Maybe try using MT Manager instead.

JavkhlanK commented 1 year ago

First you have edit the apk file with the help of apk editor ,just change anything like minimum SDK 20 then build the apk and sign the exported apk with apk signer it will work definitely.

That won't work. The app would still be using test ad IDs, no matter if it was signed or not.

subhash16 commented 1 year ago

First you have edit the apk file with the help of apk editor ,just change anything like minimum SDK 20 then build the apk and sign the exported apk with apk signer it will work definitely.

That won't work. The app would still be using test ad IDs, no matter if it was signed or not.

Bro just Export sign apk then edit with apk editor then sign with apk singer it will definitely work.I tested

devkumar00001 commented 1 year ago

First you have edit the apk file with the help of apk editor ,just change anything like minimum SDK 20 then build the apk and sign the exported apk with apk signer it will work definitely.

That won't work. The app would still be using test ad IDs, no matter if it was signed or not.

Bro just Export sign apk then edit with apk editor then sign with apk singer it will definitely work.I tested

Not working bro

STICKnoLOGIC commented 1 year ago

Caution: If you sign your APK using apksigner and make further changes to the APK, the APK's signature is invalidated. If you use zipalign to align your APK, use it before signing the APK. src:https://developer.android.com/studio/command-line/apksigner

it already said what is the problem here, if I sign the project, it sign first before the zipalign, kindly see the execution process in java code (I cant find the java files for the execution order so I cant a pull a request)

JavkhlanK commented 1 year ago

That only applies when using apksigner, which isn't being used when exporting a signed APK or AAB. Sketchware Pro uses kellinwood's zipsigner instead, which should work like jarsigner, so it also aligns the file after signing just like that docs page tells to do.

That apparently doesn't work though! 😩

devkumar00001 commented 1 year ago

That only applies when using apksigner, which isn't being used when exporting a signed APK or AAB. Sketchware Pro uses kellinwood's zipsigner instead, which should work like jarsigner, so it also aligns the file after signing just like that docs page tells to do.

That apparently doesn't work though! 😩

😥

JavkhlanK commented 1 year ago

I think I've finally fixed this. Get the latest snapshot build as always if you'd like to test that out.

devkumar00001 commented 1 year ago

I think I've finally fixed this. Get the latest snapshot build as always if you'd like to test that out.

Oh! Thanks a lot ❤

devkumar00001 commented 1 year ago

I think I've finally fixed this. Get the latest snapshot build as always if you'd like to test that out.

Can I close this issue?

STICKnoLOGIC commented 1 year ago

Caution: If you sign your APK using apksigner and make further changes to the APK, the APK's signature is invalidated. If you use zipalign to align your APK, use it before signing the APK. src:https://developer.android.com/studio/command-line/apksigner

it already said what is the problem here, if I sign the project, it sign first before the zipalign, kindly see the execution process in java code (I cant find the java files for the execution order so I cant a pull a request)

can I pull a request about this? I fixed it using this method, although I also fix the installation blocked by playstore, although it needs some testing before I pull a request for both this

JavkhlanK commented 1 year ago

I think I've finally fixed this. Get the latest snapshot build as always if you'd like to test that out.

Can I close this issue?

Don't, let's keep this open until v6.4.0-rc06 is released.

JavkhlanK commented 1 year ago

Caution: If you sign your APK using apksigner and make further changes to the APK, the APK's signature is invalidated. If you use zipalign to align your APK, use it before signing the APK. src:https://developer.android.com/studio/command-line/apksigner

it already said what is the problem here, if I sign the project, it sign first before the zipalign, kindly see the execution process in java code (I cant find the java files for the execution order so I cant a pull a request)

can I pull a request about this? I fixed it using this method, although I also fix the installation blocked by playstore, although it needs some testing before I pull a request for both this

I already did that with commit c5b3f09fd0c8bdddc903fccb799bceba6b3796c5, even though the app doesn't use apksigner in some cases.

subhash16 commented 1 year ago

I think I've finally fixed this. Get the latest snapshot build as always if you'd like to test that out.

Can I close this issue?

Don't, let's keep this open until v6.4.0-rc06 is released.

When will release

devkumar00001 commented 1 year ago

I think I've finally fixed this. Get the latest snapshot build as always if you'd like to test that out.

Can I close this issue?

Don't, let's keep this open until v6.4.0-rc06 is released.

When will release

I am waiting for a long time😥

JavkhlanK commented 1 year ago

I think I've finally fixed this. Get the latest snapshot build as always if you'd like to test that out.

Can I close this issue?

Don't, let's keep this open until v6.4.0-rc06 is released.

When will release

When it's ready. It just isn't possible to estimate when exactly.