Troubleshooting pod install Error on CocoaPods

Going through the Getting Started guide for Firebase I encountered this error ‘JSON::ParserError – 767: unexpected token at ‘ and thought to blog and share how to fix it.

I went to the Xcode project directory in the terminal and ran

pod init

Then I defined the PodFile spec

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Firebase Getting Started' do
  # Comment the next line if you don't want to use dynamic frameworks
  #use_frameworks!

  # Pods for Firebase Getting Started
  pod 'Firebase/Analytics'
  # Add the pods for any other Firebase products you want to use in your app
  # For example, to use Firebase Authentication and Cloud Firestore
  pod 'Firebase/Auth'
  pod 'Firebase/Firestore'

end

But when I ran

pod install

I encountered this error

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=767%3A+unexpected+token+at+%27%27&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
 - [1.9.2] Error during pod install JSON::ParserError - 767: unexpected token
   https://github.com/CocoaPods/CocoaPods/issues/9814 [open] [31 comments]
   8 hours ago

 - https://github.com/CocoaPods/CocoaPods/search?q=767%3A+unexpected+token+at+%27%27&type=Issues
   https://github.com/CocoaPods/CocoaPods/issues/9777 [closed] [3 comments]
   2 weeks ago

 - Error during pod install: Encountered an unknown error (783: unexpected token at
   https://github.com/CocoaPods/CocoaPods/issues/9672 [closed] [92 comments]
   22 hours ago

and 12 more at:
https://github.com/cocoapods/cocoapods/search?q=767%3A%20unexpected%20token%20at%20%27%27&type=Issues&utf8=?

[!] Automatically assigning platform `iOS` with version `13.5` on target `Firebase Getting Started` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

After checking the issues. It turns out the cocoapods repo cache on my machine somehow got corrupted. To fix the error I simply deleted the cache.

sudo rm -rf ~/.cocoapods/repos

And running pod install after that worked.

How To Fix [Cannot read property ‘setParams’ of undefined] for Application Event in Aura Components

Component.cmp

    <aura:registerEvent name="CRMAppEvent" type="c:CRMAppEvent"/>

Controller.js

        var compEvent = $A.get("e.c:CRMAppEvent"); 
        compEvent.setParams({"type" : response})
        compEvent.fire();

If you have registered that this component will fire an event and still you get this odd error when setting parameters to your event.

This indicates that it cannot find the event and it is undefined.
To fix this you need to set your application event access to global

CRMAppEvent.evt

<aura:event type="APPLICATION" description="This is the generic Application Event" access="global">
    <aura:attribute name="type" type="String"/>
</aura:event>

How to Fix Salesforce Deployment Errors: InfoNot a valid enumeration for type

If your deployment strategy still evolves around ant deployment and not the new Salesforce CLI and you encounter this error on your deployment.

Failed to check the status for request ID=0Af0r00000ClbNgCAJ. Error: InfoNot a valid enumeration for type: class com.sforce.soap.metadata.DeployProblemType. Retrying…

While digging around, I found out this is a tool issue. Chances are your ant-salesforce jar library is outdated, you need to grab the latest salesforce-ant version from here

https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_install.htm

Update the library on your ant build path. Check your build.xml for the classPath if you are unsure of the path.

<taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
        <classpath>
            <pathelement location="${basedir}/ant-salesforce.jar" />
        </classpath>
</taskdef>

How to Fix Compilation Failure LWC1010: Failed to resolve entry for module

By default camel case component folder names are mapped to kebab-case in the markup when calling them from Lightning Web Components.

Eg. myComponent would be my-component

VSStudio code autocomplete would miss this example ” myCRMApp”

<my-component></my-component>
<c-my-crm-app></c-my-crm-app>

To fix this myCRMApp would be my-c-r-m-app

<c-my-c-r-m-app></c-my-c-r-m-app>

How to Fix Salesforce Deployment Errors: Platform Encryption cannot be enabled for standard fields when Portals are enabled.

Go to Salesforce Classic UI and search under Setup for “Customer Portal” and Disable Login Enabled. You should move your portal to Communities where Platform Encryption is supported.