Error with duplicates in codenameone_library_appended.properties

14 views
Skip to first unread message

nickk...@gmail.com

unread,
Jul 25, 2016, 8:17:54 PM7/25/16
to CodenameOne Discussions
If I have two separate cn1libs that add the same build hints in codenameone_library_appended.properties they get added twice and then won't build due to duplicates (i.e., android.xpermissions, android.xapplication)

Unfortunately the only workaround I've found not practical for a sensible build and maintenance process.

1. Unzip one of the cn1libs and edit the file not to include the build hints that are duplicated
2. Zip it up again.
3. Edit codenameone_settings.properties to remove all of the entries that are going to be injected again
4. Refresh libs

Repeat any time a new library is added that might clash or updated library is available. 

Is there a better process to manage cn1libs that request the same permissions? Are these duplicates checked in the build process anywhere?

Particularly with permissions where they are standard blocks I think a better system than adding them to xpermissions should be looked at. I realise for xapplication or the iOS build hints that inject code they are needed for flexibility, but permissions can really just be a list rather than a long string of xml and one that doesn't put duplicate records into the Manifest as part of the build process.

Cheers,
Nick

Shai Almog

unread,
Jul 26, 2016, 12:09:02 AM7/26/16
to CodenameOne Discussions, nickk...@gmail.com
The whole idea of appended is to avoid the duplicates. Are these libraries that we ship?
What's in the appended files?

Does it list android.xpermissions twice? That's impossible AFAIK.
Or does it include a specific xpermission twice?

If the latter there is a trick. We use build hint variables which is something I meant to blog about but you can see sample usage in the Google Maps cn1lib.
Reply all
Reply to author
Forward
0 new messages