3

I have my SwiftUI app where I am only using import GooglePlaces.

To use Google Places I had to install the package from: https://github.com/YAtechnologies/GoogleMaps-SP

The problem is that when I am trying to release the app, more package will appear and waste size on my app, like GoogleMaps, GoogleMapsCore and GoogleMapsBase. But I do not use those. I only use Google Places.

The review myapp.ipa content:

enter image description here

How can I remove the other packages? Also, using Google Places API is not an option because I use a lot of methods from Places.

The unused packages consume almost 40% of my total size app.

I just want to keep Google Places, and remove the other unused packages. Also, I do not use CocoaPods.

dhaval123
  • 107
  • 11
  • Looking at the Package.swift of that repository, it is setup for all of those Google Maps APIs. Try making your own fork that trims down the package to just Google Places (and its apparent Google Maps Base dependency). – HangarRash May 05 '23 at 21:45
  • Coud you explain in more detail? what do you mean by fork in this case? – dhaval123 May 06 '23 at 17:33
  • Fork means to create your own copy of the project. Github makes it as easy as clicking a link. – HangarRash May 06 '23 at 19:40
  • Cant I just copy the Places folder into my own project? – dhaval123 May 06 '23 at 21:34
  • Drag and drop places SDK into your project and remove any google pods/package – Zain May 07 '23 at 19:41

1 Answers1

0

To fix your issue you can remove and re-add the package to 'Your Project' > 'Package Dependencies' and then select libraries what you need, e.g.:

enter image description here

Or delete unused libraries in 'Your Target' > 'Framework, Libraries, and Embedded Content':

enter image description here

But your new build will still contain two libraries inside your ipa file: GoogleMapsBase.framework and GooglePlaces.framework. That's because GooglePlaces library includes two targets and you can verify this with Package.swift:

...
.library(
  name: "GooglePlaces",
  targets: [
    "GooglePlaces",
    "GoogleMapsBase"
  ]
)
...

So that GoogleMapsBase is a required dependency for GooglePlaces.

iUrii
  • 11,742
  • 1
  • 33
  • 48