<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Victor Corvalan</title>
    <description>The latest articles on DEV Community by Victor Corvalan (@vcorva).</description>
    <link>https://dev.to/vcorva</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F252916%2Fb6125517-137a-4510-807c-34aa2c08ec3e.PNG</url>
      <title>DEV Community: Victor Corvalan</title>
      <link>https://dev.to/vcorva</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vcorva"/>
    <language>en</language>
    <item>
      <title>UISearchDisplayController crashes on iOS 13</title>
      <dc:creator>Victor Corvalan</dc:creator>
      <pubDate>Sun, 02 Feb 2020 12:32:06 +0000</pubDate>
      <link>https://dev.to/vcorva/uisearchdisplaycontroller-crashes-on-ios-13-14po</link>
      <guid>https://dev.to/vcorva/uisearchdisplaycontroller-crashes-on-ios-13-14po</guid>
      <description>&lt;p&gt;The UISearchDisplayController is fully deprecated on iOS 13 and was deprecated since iOS 8. I'm maintaining an APP that is live since 2012/2013 that was using it.&lt;/p&gt;

&lt;p&gt;Last week we received a ticket reporting a crash when a user tries to enter on a part where there is a search bar on it.&lt;/p&gt;

&lt;p&gt;One important thing to note is while testing the APP running directly from XCode or generating the .IPA everything seems to work fine &lt;em&gt;(our testers didn´t get any crash or any strange behaviour)&lt;/em&gt;, only when the build is submitted to the APP STORE to test it through Testflight you get the crash. &lt;em&gt;We couldn´t reproduce the crash in a dev environment no matter what type of build we setup, how we setup the scheme or how we generate the IPA&lt;/em&gt; &lt;strong&gt;just like the APP STORE does for example&lt;/strong&gt; &lt;em&gt;to install on the device&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;That ViewController had some implementation of the UISearchDisplay that we removed, and also we notice that in the storyboard, the ViewController had some references...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GidFn73C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/t8995zze0z785675jql4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GidFn73C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/t8995zze0z785675jql4.png" alt="UISearchDisplayController on the storyboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope that this help if you are maintaining and old iOS APP and start receiving crashes reports that you can't reproduce on your environment. If you need to replace the old UISearchDisplayController, take a look to &lt;a href="https://www.raywenderlich.com/4363809-uisearchcontroller-tutorial-getting-started"&gt;this tutorial from Ray Wenderlich&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>swift</category>
      <category>ios</category>
    </item>
    <item>
      <title>Setup auto-renewable subscriptions for iOS in Flutter</title>
      <dc:creator>Victor Corvalan</dc:creator>
      <pubDate>Fri, 25 Oct 2019 10:06:51 +0000</pubDate>
      <link>https://dev.to/vcorva/setup-auto-renewable-subscriptions-for-ios-in-flutter-1905</link>
      <guid>https://dev.to/vcorva/setup-auto-renewable-subscriptions-for-ios-in-flutter-1905</guid>
      <description>&lt;p&gt;After I had successfully tested and implemented auto-renewable subscriptions on my Android APP… it was time to do the same thing for iOS… but once again… a problem came up.&lt;/p&gt;

&lt;p&gt;When I was trying to list my past purchases, on iOS I was receiving an empty list… I won’t write about a full implementation of in-app purchases in Flutter as I’m only interested in this specific problem… you can get a good tutorial from &lt;a href="https://fireship.io/lessons/flutter-inapp-purchases/"&gt;Fireship.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The thing is, on iOS, you need to call &lt;strong&gt;completePurchase()&lt;/strong&gt; in &lt;strong&gt;purchaseUpdatedStream.listen&lt;/strong&gt; … just before you complete a purchase &lt;em&gt;(yeah)&lt;/em&gt;… something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;InAppPurchaseConnection.instance.purchaseUpdatedStream.listen((purchases) {
 purchases.forEach((purchase){
 if (purchase.status == PurchaseStatus.purchased) {
 if (Platform.isIOS) {
 InAppPurchaseConnection._instance_.completePurchase(purchase);
 }
 }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you are following the tutorial from &lt;a href="https://fireship.io/lessons/flutter-inapp-purchases/"&gt;Fireship.io&lt;/a&gt;… I’ve added that call inside &lt;strong&gt;_verifyPurchase().&lt;/strong&gt; They added the &lt;strong&gt;completePurchase&lt;/strong&gt; call in &lt;strong&gt;_getPastPurchases()&lt;/strong&gt; but nothing happens if you call from there because you are going to receive always an empty list of past purchases if you don’t “confirm”.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>inapppurchase</category>
      <category>ios</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Your Flutter APP has one or more issues</title>
      <dc:creator>Victor Corvalan</dc:creator>
      <pubDate>Mon, 21 Oct 2019 02:25:58 +0000</pubDate>
      <link>https://dev.to/vcorva/your-flutter-app-has-one-or-more-issues-2bki</link>
      <guid>https://dev.to/vcorva/your-flutter-app-has-one-or-more-issues-2bki</guid>
      <description>&lt;p&gt;It was the first time that I was submitting a Flutter APP to the App Store… I thought that everything was ready… I’ve tested on several emulators, on real iOS devices… and everything went smoothly and without a problem when I uploaded to the App Store… but after their system finished processing my build, I received an email from Apple…&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;ITMS-90338: Non-public API usage&lt;/em&gt;&lt;/strong&gt; &lt;em&gt; — The app references non-public symbols in Frameworks/Flutter.framework/Flutter: _ptrace. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To avoid that issue… you should run&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;flutter build ios — release&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then in &lt;strong&gt;xCode&lt;/strong&gt; , go to &lt;strong&gt;Product-&amp;gt;Scheme-&amp;gt;Edit Scheme&lt;/strong&gt;  … and make sure that &lt;strong&gt;Build Configuration&lt;/strong&gt; is in &lt;strong&gt;RELEASE&lt;/strong&gt; for ** Archive**&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q3em6TmV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aac_7w5Pza1n2b1fLk0xA9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q3em6TmV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aac_7w5Pza1n2b1fLk0xA9w.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now you are ready to publish!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>flutter</category>
    </item>
    <item>
      <title>Flutter Fatal Exception in Firestore Android</title>
      <dc:creator>Victor Corvalan</dc:creator>
      <pubDate>Sun, 20 Oct 2019 00:15:34 +0000</pubDate>
      <link>https://dev.to/vcorva/flutter-fatal-exception-in-firestore-android-48e8</link>
      <guid>https://dev.to/vcorva/flutter-fatal-exception-in-firestore-android-48e8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OaekS3QF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AmUnZxae7oC5-ov-HWgDFGw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OaekS3QF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AmUnZxae7oC5-ov-HWgDFGw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Flutter Fatal Exception in Firestore Android&lt;/p&gt;

&lt;p&gt;Yesterday I was facing an unexpected crash in production (&lt;em&gt;How did this happen&lt;/em&gt;?) to be short, I do not own a physical Android device to test RELEASE builds, in theory I was adding a small, almost insignificant change… but doing some Flutter Clean here, Flutter Package Get over there, Android CLEAN, Android BUILD and that kind of things… SOMETHING IMPORTANT DID ACTUALLY CHANGED.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FATAL EXCEPTION: main
Process: com.app.android, PID: 12668
java.lang.RuntimeException: Internal error in Firestore (19.0.0).
 at com.google.firebase.firestore.g.j.a(:379)
 at com.google.firebase.firestore.g.g.run(Unknown Source:2)
 at android.os.Handler.handleCallback(Handler.java:873)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:193)
 at android.app.ActivityThread.main(ActivityThread.java:6718)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After digging and digging and trying to figure out what was happening, I realize that disabling useProguard and minifyEnabled I was able to fix that crash… BUT what the hell?? I didn’t change or add any proguard rules or gradle file… so, finally found WHAT was actually causing that crash thanks to my GIT file status… and guess what I’ve found…&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;android.enableR8=true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Some how R8 got added AND enabled in my gradle.properties file!. Changing the value to FALSE got my APP running and free of crashes.&lt;/p&gt;

</description>
      <category>firestore</category>
      <category>flutter</category>
      <category>android</category>
    </item>
  </channel>
</rss>
