How to reduce size of app with arcgis dependency? - arcgis

I'm starting to work on an iOS app, which should use ArcGIS. I've added a hello world style (1 screen, 1 map without any extra stuff) basic implementation, and now my app size is trough the roof. I've followed this tutorial for the setup.
A development build app size on the iPhone X used to be 50Mb (it's not a very complex app), now it's 510Mb. An archive is 750Mb.
I'm not sure if the release process (Appstore upload) would reduce that (I guess not).
Here is my Podfile
platform :ios, '10.0'
use_frameworks!
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings.delete('CODE_SIGNING_ALLOWED')
config.build_settings.delete('CODE_SIGNING_REQUIRED')
end
end
target 'AppName' do
pod 'Kingfisher', '~> 4.8.0'
pod 'RxSwift', '~> 4.2.0'
pod 'RxCocoa', '~> 4.2.0'
pod 'HockeySDK', '~> 5.1.2'
pod 'XCGLogger', '~> 6.0.4'
pod 'Floaty', '~> 4.0.1'
pod 'CTPanoramaView', '~> 1.1'
pod 'Alamofire', '~> 4.7.3'
pod 'ArcGIS-Runtime-SDK-iOS', '100.3'
end
The app size of the SDK Sample in the appstore is 100Mb on my iPhone X, so I guess that would be a more reasonable size for my app too.
What steps could I do to reduce the app size?

The impact should be about 65-70Mb. You're probably looking at the Universal ipa. Please see this answer to a similar question and let us know if that helps: iOS ArcGIS.framework too large, hence large .ipa size

Related

Use Pod library for only development not for production

I have pod library which helps developer at development time but no use when the application is released, So is there anything which helps me.
any changes in setting at the consumer side, which consume pod library.
or
any changes in setting in the pod library itself, because library is also created by me.
In podfile we need to add configuration to debug
pod 'podname', :configurations => ['Debug']
and below for release
pod 'podname', :configurations => ['Release']
In Xcode, open the project settings, in the "Targets" list column, right click on your main iOS target and duplicate it to create one just for development.
In your Podfile, list up the your development-purposed pods under your new development target name. A rough example:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'Your_App_Development' do
pod 'SomeDevOnlyPod', '~> 5.6'
end
Hope that helps!

React Native Firebase starter and React Navigation

I want to use the react native firebase starter template and add react navigation.
I have got the react-native-firebase-starter project up and running and have linked it to firebase. But now when I follow the steps to add react-navigation I come into problems with react-native link react-native-gesture-handler.
I guessed because the project uses cocoa pods and this command adds a line to the Podfile, that I should cd ios and run pod install.
The problem then is that I get an error: [!] React has been deprecated and the project won't build.
Has anyone successfully used this starter project and added react-navigation to it?
Please tell me what I'm doing wrong or what to do to get it sorted.
I figured this out.
You need to add these lines into your app target in the Podfile...
pod 'React', :path => '../node_modules/react-native'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
And then at the very bottom of the Podfile you need to add the following...
post_install do |installer|
installer.pods_project.targets.each do |target|
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
This removes React & Yoga from the Pods project, as it is already included in the main project.

React Native app opens and closes quickly after installation on ios simulator

I've been developing an App using React Native and when I switched to a Mac environment to set up the configurations for ios, after all the setup has been done, the app opens very quickly and closes after the installation, showing that powered by react native screen. I noticed that in my packager screen, the line from the bundle which shows a progress of how much has been loaded does not appear, as if it has never been loaded. Same thing happens if I try to run the code from Xcode.
Here is the screen I'm talking about, for a test project I started for comparisson purposes:
And here is the same screen for my App, without the progress indicator being displayed:
I tried following some solutions provided by the comunity for similar issues but none of them worked. Note that no error message is displayed in my terminal window, as if the build and installation has been succesfull.
Can someone help me with this one? I've been strugling with this App for quite some time, as react native always seems to crash and display error messages for me. Any help would be much appreciated :)
Edit: forgot to mention that I'm trying to run the app on the simulator since I don't have an actual device.
Exactly this problem happened to me yesterday when I too installed react-native-firebase. I ran react-native run-ios and the app closed as soon as it opened without any specific errors.
I decided to run the app from Xcode, so I opened the Xcode project. To be more precise I opened the <Project>.xcworkspace because I installed CocoaPods. And there inside the logs I when trying to run the app I found the error. It said that the GoogleService-Info.plist was not found. And as I was looking through the Xcode workspace I did not see the file there, although it existed under /ios/<Project>/ in my IDE (VSCode). So maybe just a syncing problem.
So basically I added the file in Xcode as well, re-run and app was running fine.
Of course, I have no idea if I can find some sort of credible sources about this, but this exact issue happened to me under the exact same circumstances as yours.
Some solutions ...
If you are in latest react version then try to downgrade it.
Re-start your application and try to run again.
Delete node modules folder and run using npm install.
Try to open project using XCODE and build through it.
Most probably the problem is with your react version. Try to downgrade to stable react version and try
Check the log for errors, run react-native log-ios on the terminal and monitor it for errors.
or you can enable Debug JS Remotely option from the simulator by pressing command+D and check the console for errors.
Try to use adb logcat *:E, this will be helpful when you trying to find issues not related js.
I depends on the version of your react-native, if you are using its latest version , 0.56.0 (for now) it has a known issue, which you can see here, and it is suppose to be fixed in next version 0.57.0
https://github.com/facebook/react-native/issues/19953
although the issue raised for android version, but it has similar issue in ios
(the latest comment, provides more info about the error)
for now the possible fix is to downgrade to 0.55.4 or 0.55.0
if this couldn't solve your issue, Please provide more information about your app with adding package.json and build.gradle info to the question
Add firebase crashlytics or open again and again that app, so it navigates to the log screen to find the issue. Mainly it caused by the misconfigured pod settings. So please check your Podfile. because all the other errors are comes in app's internal error console. I'm attaching the Non error formed Podfile for your reference. It's only the example
Podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.0'
target 'iospodapp' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse.podspec"
pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary.podspec"
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary.podspec"
pod 'YogaKit'
pod 'Firebase/Performance'
pod 'Firebase/Messaging'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-orientation', :path => '../node_modules/react-native-orientation'
pod 'RNFS', :path => '../node_modules/react-native-fs'
target 'iospodappTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
end
Note:
If you're using the firebase, don't forget to add the GoogleService-Info.plist into your ios directory through xcode.
If you're using firebase analytics that also makes the crash. because it needs too more configurations to avoid the crash. so check your build without firebase analytics first. If everything is fine, you can add the analytics later
If it occurs without any major changes
close Terminal, Emulator and any other application related.
clean the project
clean cache
npm start -- --reset-cache
clean and Install pod file
Cd IOS && podinstall
Rebuild the project.
I'm experiencing the same issue since yesterday, the app Im working on is old we are using "react": "16.8.3", "react-native": "^0.59.10", although the app used to work for me properly before, I cloned a fresh copy of the app from the github repo and it worked for the first time, then I again issued the same command npx react-native run-android and after installing the app should open while opening it starts to crash with no error, I see similar metro bundler screen as has been shared in the question. I tried to run the android folder via android studio I could see one issue which Im not able to resolve since yesterday
/node_modules/#react-native-community/netinfo/android/gradle.properties
(Operation not permitted)
which Im not able to figure out how to solve.

Integrating cocoa pods with App extension

I am working in a project, with cocoa pods integration.
My pod file's content as pasted below
platform :ios, '8.0'
pod 'AFNetworking'
pod 'MBProgressHUD'
pod 'HDTableDataSource'
pod 'HDCollectionDataSource'
pod 'HDAlertShortkut'
pod 'TouchXML'
pod 'ARAutocompleteTextView'
pod 'AMTagListView'
link_with 'ApplicationName', 'ExtensionName'
My code is in Objective C, The problem that I am currently facing is I can not import AFNetworking library in Extension's view controller.
Kindly help me to solve the problem.

what could be the reason not called completionHandler in uploadTaskWithRequest:fromFile:progress:completionHandler: iOS8

AFNetworking pods:
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.2'
When I upload some file via AFURLSessionManager -uploadTaskWithRequest:fromFile:progress:completionHandler: and was lost internet connection on iOS 7 completionHandler called with error, but in iOS 8 - not at all called.
What could be the reason?