Integrating Proguard into NativeScript 6.5.1

Hi @Jesse ,
My name is Augusto, I’m from Santiago of Chile South of America. I’m tryin to integrate proguard with App NativeScript 6.5.1 framework. So far without success, when executing the App an A / libc error occurs: Fatal signal 6 (SIGABRT). I need your help to get out of this problem.
Thanks.

Hi AVOGT,

First of all, welcome to the community!
I understand that you have been experiencing issues while configuring ProGuard to optimize your application. I saw that you have raised a similar issue on github: Proguard not working with NativeScript 6.5.1 · Issue #169 · Guardsquare/proguard · GitHub

I would like to ask you if you have successfully applied the indicated changes provided by my colleague James? In case you have been able to apply these changes but you are still not able to use ProGuard as intended, can you please share an updated version of the project (zip folder you shared on GitHub) so that we can take a closer look at what might still go wrong?

Kind regards,

Ewout

Hi @ewoutd,
Yes, apply the indicated changes, but I still can’t compile the application successfully, add several rules in the project’s proguard-rules.pro file. but they are not enough and the compilation ends with error. I cannot add evidence for your review.

Hi @AVOGT ,

Could you please elaborate on the rules you have added to the proguard-rules.pro file and the exact error you get at compile time? In case you would not be able to upload any files here, you can make a new topic in the “Ask a Question” section. You should be able to provide us with an updated version of the sample project you shared via GitHub there.

Kind regards,

Ewout

Hi @ewoutd ,
Add some changes to the rules in the proguard-rules.pro file, thus achieving a successful compilation with warnings but when executing the application it throws memory errors, running and stopping continuously (memory corruption), it remains in a loop. I attach evidence of what happened in the following github url:

Thank you.

Hi @AVOGT,

Could you please try to use the “-dontoptimize” option in your proguard-rules.pro file?

Kind regards,

Ewout

Hi ewoutd,
Apply the change in my rules file, not being successful. Apparently our app is not compatible with Proguard, it is too frustrating not being able to run it successfully.

Greetings.

Hi @AVOGT ,

Sorry this has been an inconvenience. The only other suggestiosn we have that relates to ProGuard in this situation are the following:

  1. Try to add the following keeprule:

-keep class ** { *; }

  1. Please try to add the 3 dont options to your configuration file all together:

-dontoptimize
-dontobfuscate
-dontshrink

Please reach out again to tell us about the results after you have tried to apply the suggestions above.

Kind regards,

Ewout

Hi @ewoutd,
Applying the 3 dont options works, but that is the same as enabling minifyEnabled false, I do not understand what would be the contribution to use these options.

Greetings.

proguard-rules.pro (4.82 KB)

Hi @AVOGT ,

Thanks for the update! The reason why I asked you to turn on these dont options is to further narrow down the problem.
Could you try to use the dontobfuscate and dontshrink options separately to see which one is causing the issue?
On top of that, I would like to raise the awareness about the -addconfigurationdebugging feature.
This feature might allow you to ` instrument the processed code with debugging statements that print out suggestions for missing ProGuard configuration. This can be very useful to get practical hints at run-time , if your processed code does not behave as expected because it still lacks some configuration. You can generally just copy/paste the suggestions from the console into your configuration file.

Please do not use this option in release versions, as it adds obfuscation information to the processed code.

Kind regards,

Ewout

Hi @AVOGT ,

I spent some more time taking a look at your problem. I took the sample application shared with James on github. The app works properly and no memory issues occur at runtime. Is it possible that you are only seeing these memory related problems on your actual application instead of this sample application? In that case, we would highly appreciate it if you could share another sample application with us that reproduces the problems you are currently experiencing. Once we get our hands on this sample application, we will make it a priority to further assist you in solving this problem.

Best regards,

Ewout

1 Like