Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pod spec lint error with On Demand Resources #10933

Closed
1 task done
penelopearaujo opened this issue Sep 9, 2021 · 22 comments
Closed
1 task done

pod spec lint error with On Demand Resources #10933

penelopearaujo opened this issue Sep 9, 2021 · 22 comments
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Milestone

Comments

@penelopearaujo
Copy link

Report

What did you do?

  • added a .ttf file to my project
  • added a on demand resource tag to my .ttf file
  • added spec.on_demand_resources key in my podspec and specified the path to the .ttf file
  • ran pod spec lint

What did you expect to happen?

expected the spec to pass validation so that I could push it to cocoapods

What happened instead?

running pod spec lint resulted in the error:

- NOTE  | [iOS] xcodebuild:  error: On-Demand Resources is enabled (ENABLE_ON_DEMAND_RESOURCES = YES), but the PRODUCT_BUNDLE_IDENTIFIER build setting is empty (in target 'App' from project 'App')

I do not have a target or project called App, and the PRODUCT_BUNDLE_IDENTIFIER build setting is set in my project's info.plist as $(PRODUCT_BUNDLE_IDENTIFIER)

CocoaPods Environment

Stack

   CocoaPods : 1.11.0
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.7 (19H1030)
       Xcode : 12.4 (12D4e)
         Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ a8db5c55f0110d6aa92bda70707e7b0e925a6624

               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /usr/local/Cellar/cocoapods/1.11.0/libexec/bin/pod

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0
@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

Oh that is a great issue report! We will fix for 1.11.1. We have apps building for ODR but no lint tests. Thanks a lot. We can ship this release hopefully this week.

@dnkoutso dnkoutso added this to the 1.11.1 milestone Sep 9, 2021
@dnkoutso dnkoutso added the t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome! label Sep 9, 2021
@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

@penelopearaujo I cannot seem to reproduce locally. Do you have a sample repo I can try this with or a podspec?

@dnkoutso dnkoutso added the s1:awaiting input Waiting for input from the original author label Sep 9, 2021
@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

makes me wonder if this an Xcode related issue? I tried Xcode 13 beta and it passed and Xcode 12.5.1 and it passed locally.

@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Sep 9, 2021
@dnkoutso dnkoutso added the s1:awaiting input Waiting for input from the original author label Sep 9, 2021
@penelopearaujo
Copy link
Author

Thanks, @dnkoutso! I will try again after updating Xcode to 12.5.1 version :)

You can reproduce the error with this sample project, which does nothing, but tests this ODR thing.

@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Sep 9, 2021
@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

awesome

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

Yes I tried your sample repo and I cant repro at this time.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

@penelopearaujo in your repo there is no actual .ttf resource present?

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

Well there is ./palettes/palettes/Roboto-Regular.ttf but your on_demand_resources is:

  spec.on_demand_resources = { 'roboto' => ['Sources/Resources/*.ttf'] }

which doesnt match it.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

OK after messing around with it I repro'd!

- NOTE  | [iOS] xcodebuild:  /var/folders/yt/vszldnq143dgzjmmgr_tqs540000gn/T/CocoaPods-Lint-20210909-58421-1jay8rt-Palettes/App.xcodeproj: error: On-Demand Resources is enabled (ENABLE_ON_DEMAND_RESOURCES = YES), but the PRODUCT_BUNDLE_IDENTIFIER build setting is empty (in target 'App' from project 'App')

@dnkoutso dnkoutso added the s2:confirmed Issues that have been confirmed by a CocoaPods contributor label Sep 9, 2021
@penelopearaujo
Copy link
Author

Yes! I forgot to commit after moving things around 🤦🏻‍♀️
Anyways, I'll let you know if it works after updating Xcode!

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

it should not be an Xcode issue I dont think. I got a fix already coming up.

@penelopearaujo
Copy link
Author

Cool! Thanks ;)

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

PR #10936

@dnkoutso dnkoutso closed this as completed Sep 9, 2021
@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

Fixed and merged! You can use bundler to point to the 1-11-stable branch to get this fix, I will ship 1.11.1 this week or early next.

@penelopearaujo
Copy link
Author

penelopearaujo commented Sep 14, 2021

Hey! Updated the version (now using 1.11.2), running pod spec lint now passes validation, but pod trunk push returns error:

[!] The Pod Specification did not pass validation.
The following validation failed:
- Warnings: Unrecognized `on_demand_resources` key.

Is it related or should I open another issue for this?
Thanks!

@dnkoutso
Copy link
Contributor

do not open yet a new issue let me verify on my end.

@dnkoutso
Copy link
Contributor

@penelopearaujo I just tried your sample repo again with 1.11.2 and it passes:

 -> Palettes (0.0.2)
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Building targets in parallel
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | xcodebuild:  note: Build preparation complete
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Analyzing workspace
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description

Pods workspace available at `/var/folders/yt/vszldnq143dgzjmmgr_tqs540000gn/T/CocoaPods-Lint-20210914-3981-y3ldra-Palettes/App.xcworkspace` for inspection.

Palettes passed validation.

make sure you are using 1.11.2.

Try pod --version first to see the output.

@dnkoutso
Copy link
Contributor

gem update cocoapods also.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 14, 2021

The podspec:

Pod::Spec.new do |spec|

  spec.name         = "Palettes"
  spec.version      = "0.0.2"
  spec.summary      = "A pod to get palettes and assets."

  spec.description  = <<-DESC
                  A pod to get instant and beautiful color palettes.
                   DESC

  spec.homepage     = "https://github.com/penelopearaujo/palettes"
  spec.license       = 'ISC'

  spec.author        = { "PMPA" => "pmpa@cin.ufpe.br" }

  spec.source       = { :git => "https://github.com/penelopearaujo/palettes.git", :tag => "#{spec.version}" }
  spec.source_files  = "**/*.{swift,h,m}"
  spec.on_demand_resources = { 'roboto' => ['palettes/palettes/Roboto-Regular.ttf'] }

  spec.pod_target_xcconfig = {"PRODUCT_BUNDLE_IDENTIFIER" => "me.pmpa.palettes" ,"DEVELOPMENT_TEAM" => "PMPA"}

  spec.swift_version = '5.0' 
  spec.platform      = :ios, '14.4'

end

@dnkoutso
Copy link
Contributor

oooh @penelopearaujo I see its pod trunk push that is the issue. This is currently blocked by this PR CocoaPods/trunk.cocoapods.org#317

@dnkoutso
Copy link
Contributor

@penelopearaujo I will try to land that PR today or tomorrow (PST) and unblock you. Thanks for your patience.

@penelopearaujo
Copy link
Author

Yes, that's the problem! I was moving code around to check if the issue was local before replying, haha.
I'll wait for the merge, no problems. Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

No branches or pull requests

2 participants