objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
970 stars 119 forks source link

ObjectBox does not contain armv7 #106

Open rmtmckenzie opened 4 years ago

rmtmckenzie commented 4 years ago

When building with flutter I'm getting this error:

fatal error: lipo: -extract armv7 specified but fat file: <project path>/build/ios/Debug-iphoneos/Runner.app/Frameworks/ObjectBox.framework/ObjectBox does not contain that architecture`

As much as I don't think I really need to support armv7 necessarily, it does seem important for now as I will keep running into this unless I disable it in my XCode project. Note that if I build with XCode I'm not getting the same error.

greenrobot commented 4 years ago

As there are no recent 32 bit iPhones we decided not to ship ARMv7. There was a way to tell Flutter that this is fine, but don't recall details atm.

rmtmckenzie commented 4 years ago

That's fair enough I guess - but by not shipping it, you're creating a problem each and every developer who wants to use ObjectBox will have to fix in their project, whether they're a proficient iOS developer or not, as that's the default in Flutter and in XCode for now. And it's not even documented.

Not to take away from the amazing work that has been done on ObjectBox - but while that might seem unimportant to you, it's the last 1% that might make a difference between developers actually adopting it or not. And I'm lucky enough not to have to support super old iPhones (although I have been up until now and I'll have to lose that support just to continue using objectbox), but I've dealt with more than a few developers especially in developing countries who don't have that luxury. And build errors can be incredibly frustrating even when you do have some sort of idea of what's going on with XCode, which fewer and fewer flutter developers will as time goes on and flutter gets attention from non-mobile developers who might be tasked with a multi-platform project. I'd highly recommend supporting the same base level as flutter does until it drops support for armv7.

And for anyone who runs across this in the future, it is actually quite simple to remove armv7. Just open up the build settings for your project in XCode and under architectures, remove ${ARCHS_STANDARD) and replace it with arm64.

greenrobot commented 4 years ago

@rmtmckenzie Thanks for sharing your perspective. We might support 32 bit (also because of Watch support) in the future, and will consider the reasoning you brought up here too. I'd be interested in additional statistics about old 32 bit iPhones; the typical ones you find online basically tell that they are not relevant to apps that are actively developed.

What do yo mean it's default in Xcode? I don't remember making any adjustments. Hmm, maybe it has to do with lowering min version from iOS 10 to 9 in the last release?

Anyway, as a first step, we'll update our docs to have this more prominently. Thanks for your input!

greenrobot commented 4 years ago

iOS 9.3 is the newest version for iPhone 4s (2011), which has a 32 bit CPU. Thus, this might make Xcode ask for a ARMv7 lib. Might try to go back to 10.3 until we do 32 bit.

Related: https://github.com/objectbox/objectbox-swift/issues/35

greenrobot-team commented 4 years ago

Added installation step to README and added FAQ for this.

rmtmckenzie commented 4 years ago

@greenrobot The ${ARCHS_STANDARD} in architectures in build settings is resolving to armv7 arm64 - that's what I meant by it's the default. And I have ended up setting iOS 10 as my minimum, but it's still trying to build armv7 for some reason. Maybe bumping it up to 10.3 would change that, although I think I remember cocoapods saying it only really does changes for major versions (I could be completely wrong about that though).

And yeah I don't think that 32 bit iPhones are much of a factor really. The build issues were definitely the more significant concern for me.