Unable to proguard my extension

Hello,

I am using App Inventor Sources to create my extension. I want to use Proguard to obfuscate the code but when I run ant extensions -Dproguard=1 extension doesn't builds and throws the following error.


I didn't changed proguard.cfg file all the rules are default.

For extension template we need to change build.xml :

1 Like

I am using sources :neutral_face::neutral_face::neutral_face:

Read again.

1 Like

you can't run it with a command like that you have to run it with a command like this :

ant extensions -Dproguard=1

Look at this Message in your build.xml which is in components folder :

ProGuard: obfuscates and minifies the AndroidRuntime.jar file, containingthe extensions source code. Only runs if the task has been calledlike "ant extensions -Dproguard=1".

1 Like

Sorry my bad :expressionless:
I ran ant extensions -Dproguard=1
forgot to write extensions in first post :sweat_smile: :sweat_smile:

1 Like

:rofl: :rofl: :rofl: hahahahahhaha

@Techno_Vedang don't forget to close this topic. Thank you :kissing_heart:

1 Like

check the edit now :joy:

:rofl: :joy:
oh ant extensions -Dproguard=1 not works too, even though it works on me :thinking:

1 Like

image

does your extension contain libs?

1 Like

yes it contains unity sdk

Okay for extension that contains lib.
Should look at this message in your build.xml and I hope your problem can be solved

<!-- FOR DEVELOPER: Add the needed libraries for your extension right herelike the ones above, just after copying them to the depsdirectory.<libraryjar file="${public.deps.dir}/my-awesome-library.jar" /> -->

1 Like

still the same error : ( is there any possibilities of issues in my sources? should I reclone it?

can you show me where you put a line like this
<libraryjar file="${public.deps.dir}/my-awesome-library.jar" />
(Screenshot)

1 Like

image

if you build your extension without proguard does it work?

1 Like

Yes it works

@ewpatton sir please help

Did you also add the relevant libraries to the CopyComponentLibraries target? Do you see that target being run in the ant log? If that target doesn't run, the libraries won't be in the expected location.

1 Like