Xamarin proguard.ParseException: Unknown parameter '' on line 1 of the file 'Properties / proguard.cfg'

I am trying to use proguard with Xamarin. So I included it in the project settings (checked Enable ProGuard) and I created the file proguard.cfgin the properties (like a new text file, right?) And checked the BuildAction -> ProguardConfiguration

Proguard File Configuration

The proguard file contains only a -keep configuration with a comment. I leave or delete a comment, I always get a parsing error on line 1:

# test comment 
-keep class !android.support.v7.view.menu.**, !android.support.design.internal.NavigationMenu, !android.support.design.internal.NavigationMenuPresenter, !android.support.design.internal.NavigationSubMenu, android.support.** {*;}

I get an error Unknown option '' in line 1.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: : : 1. : proguard.ParseException: '' 1 '/proguard.cfg'
№ 10 proguard.ConfigurationParser.parse(ConfigurationParser.java:191) proguard.ProGuard.main(ProGuard.java:484) (WheezMe.Droid)

?

+4
2

, , ( ):

.. , , (BOM), ProGuard :

Unknown option '-keep' in line 1 of file 'proguard.cfg'

, , . , Notepad ++, Encoding > Encode in UTF-8 Without BOM, ProGuard .

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_1_-_preparing_an_application_for_release/#ProGuard

, . Notepad ++ . , .

EDIT:

:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/proguard/#File_Issues

+8

perl:

perl -e 's/\xef\xbb\xbf//;' -pi~ proguard.cfg 
+2

Source: https://habr.com/ru/post/1650029/


All Articles