Cocoapods error: 'Unable to read the license file'

前端 未结 10 1652
挽巷
挽巷 2021-01-11 14:20

When I type

pods install

or

pods update

I get the following error for one library:

Unable

相关标签:
10条回答
  • 2021-01-11 14:47

    In my case this was related to someone in my team committing their .xcworkspace file to the repository, which meant running pod install gave me the licence warnings but at the same time, did not install my pods properly.

    This is how I resolved it:

    1. First close Xcode.
    2. List item
    3. Delete the Pods folder from your project
    4. Delete the .xcworkspace file,
    5. Delete the Podfile.lock file
    6. And then finally, for good measure delete the DerivedData folder

    Now run pod install and the issue should be fixed.

    0 讨论(0)
  • 2021-01-11 14:47

    I get this frequently. This works for me.

    1. pod deintegrate
    2. pod setup
    3. pod install

    From terminal I run this altogether like this pod deintegrate && pod setup && pod install

    0 讨论(0)
  • 2021-01-11 14:49

    run

    pod deintegrate

    then

    pod cache clean --all

    and

    pod install

    0 讨论(0)
  • 2021-01-11 14:53

    I just had this issue today, seems to have been caused by my cache being corrupted somehow; perhaps a charset issue? No idea, but the solution that worked for me was the bash script in this Gist.

    It clears the cocoapods cache so that you get a fresh copy of all required when you next run pod install. Fixed my problem immediately, confirming my suspicion, and hasn't reoccurred since.

    0 讨论(0)
  • 2021-01-11 14:53

    If I copy the old pod.lock from an old git branch over the latest git branch I no longer see 'pods is out of sync', and I don't have to redo 'pod update' 'pod install' again.

    Someone in the team updated pods, and therefore the pods.lock file changed version the scribbly alphanumeric characters next to the libraries we use.

    What's up with that though? Seriously if we update our libraries and then change to a different branch we'll need to update pods and rebuild - Is this the way the process is intended to be for pods and git?

    0 讨论(0)
  • 2021-01-11 14:55

    In my case, the pods which complained about the LICENSE file didn't actually have a LICENSE file in their folders. My steps to fix this:

    1. Went to [project_name] -> Pods
    2. Opened a pod which already had a LICENSE file. Copied that file and pasted it inside the pod folder which is complaining.
    3. Found the complaining pod on cocoapods.org
    4. On the bottom of the page, there is written who owns the copyright (MIT, Apache, etc.)
    5. Click on the link that's in the License part, and you will be redirected to the page where you will find an example of a copyright statement. Copy and replace the old copyright from the file you have in the folder now.
    6. In the [year] field check the latest when the pod was updated.
    7. In the [copyright owner] use what's written on the pods page under Author.
    8. Save the file.
    9. run pod install in the terminal.

    Use this image for reference.

    0 讨论(0)
提交回复
热议问题