Derek Johnson Active Member Licensed User Longtime User Jun 5, 2015 #1 I would like to conditionally include a regular B4A library, say FusedLocationProvider, so that I can omit it in builds that do not require it but include it when needed. Erel suggested that it would involve using Code: Copy #If FLP #AdditionalJar: FusedLocationProvider #End if So I omitted FusedLocationProvider from the list of libraries, hoping that would work. However if I do that then this statement fails to compile: Code: Copy #If FLP Dim FLP1 As FusedLocationProvider #End If B4A version 4.30 Parsing code. Error Error parsing program. Error description: Unknown type: fusedlocationprovider Are you missing a library reference? Occurred on line: 28 Dim FLP1 As FusedLocationProvider Click to expand... So not quite so simple as I hoped. However I've heard that there might be a solution hopefully not too complicated! It seems like what is needed is a conditional deletion of a jar/library file at compile time, so that the editor still recognises the elements of an included library but then they are removed before compilation. Derek Last edited: Jun 5, 2015
I would like to conditionally include a regular B4A library, say FusedLocationProvider, so that I can omit it in builds that do not require it but include it when needed. Erel suggested that it would involve using Code: Copy #If FLP #AdditionalJar: FusedLocationProvider #End if So I omitted FusedLocationProvider from the list of libraries, hoping that would work. However if I do that then this statement fails to compile: Code: Copy #If FLP Dim FLP1 As FusedLocationProvider #End If B4A version 4.30 Parsing code. Error Error parsing program. Error description: Unknown type: fusedlocationprovider Are you missing a library reference? Occurred on line: 28 Dim FLP1 As FusedLocationProvider Click to expand... So not quite so simple as I hoped. However I've heard that there might be a solution hopefully not too complicated! It seems like what is needed is a conditional deletion of a jar/library file at compile time, so that the editor still recognises the elements of an included library but then they are removed before compilation. Derek
Erel B4X founder Staff member Licensed User Longtime User Jun 7, 2015 #2 The FusedLocationProvider library itself is quite small (less than 100kb). The problem is that it depends on google-play-services.jar which is a large jar (3m+). The solution is: 1. Edit FusedLocationProvider.xml and remove the DependsOn line (near the bottom). 2. Keep the library checked in the IDE. 3. Conditionally add google-play-services.jar with #AdditionalJar: google-play-services Upvote 0
The FusedLocationProvider library itself is quite small (less than 100kb). The problem is that it depends on google-play-services.jar which is a large jar (3m+). The solution is: 1. Edit FusedLocationProvider.xml and remove the DependsOn line (near the bottom). 2. Keep the library checked in the IDE. 3. Conditionally add google-play-services.jar with #AdditionalJar: google-play-services