2016-05-24 16 views
8

Sto tentando di creare nuovamente il mio primo pod. Ci ho provato molto tempo fa, 1 anno fa, ricordo che anche quella volta ho avuto un errore simile.Errore di convalida di Podspec - Pattern di file: la specifica è vuota

codice seguente mostra come il mio file project.podspec sembra, non so quello che mi manca qui, CocoaPods solo letteralmente inveire contro di me, dicendo che ci sono alcuni problemi in podspec file.

Pod::Spec.new do |s| 
    s.name = 'MyProject' 
    s.version = '0.1.0' 
    s.platform = :ios, '9.0' 
    s.license = 'MIT' 
    s.summary = 'Something Blah Blah' 
    s.homepage = 'https://github.com/alvinvarghese/MyProject' 
    s.author = { 'Alvin Varghese' => 'my email' } 
    s.source = { :git => 'https://github.com/alvinvarghese/MyProject.git', :tag => s.version.to_s } 

    s.description = 'Blah Blah Blah BlahBlah BlahBlah BlahBlah BlahBlah Blah Blah Blah'  \ 
        'Blah Blah' 
    s.frameworks = 'UIKit', 'Foundation' 
    s.social_media_url = 'https://twitter.com/aalvinv' 
    s.ios.deployment_target = '9.0' 
    # s.resource_bundles = { 
    # 'dummy' => ['dummy/Assets/*.png'] 
    # } 

    s.public_header_files = 'Pod/Classes/**/*.h' 
    s.frameworks = 'UIKit', 'Foundation' 
    # s.dependency 'AFNetworking', '~> 2.3' 

end 

ho idea di come questo funziona anche, quando corro pod trunk push --allow-warnings, ottengo questo errore.

Alvin-The-Robot:MyProject Alvin$ pod trunk push --allow-warnings 

[!] Found podspec `MyProject.podspec` 
Updating spec repo `master` 
Validating podspec 
-> MyProject (0.1.0) 
    - ERROR | [iOS] File Patterns: The MyProject (0.1.0) spec is empty (no source files, resources, resource_bundles, preserve paths, vendored_libraries, vendored_frameworks, dependencies, nor subspecs). 
    - ERROR | [iOS] unknown: Encountered an unknown error (The `MyProject` pod failed to validate due to 1 error: 
    - ERROR | [iOS] File Patterns: The MyProject (0.1.0) spec is empty (no source files, resources, resource_bundles, preserve paths, vendored_libraries, vendored_frameworks, dependencies, nor subspecs). 

) during validation. 

[!] The spec did not pass validation, due to 2 errors. 

Fammi sapere i tuoi pensieri, sto facendo qualcosa di sbagliato? Mi manca qualcosa?

E alcune altre cose che potrebbero essere utili. Il repository git ha lo stesso tag 0.1.0.

Alvin-The-Robot:MyProject Alvin$ git tag 
0.1.0 

Grazie ragazzi in anticipo.

+0

Per la fonte: 'https: // github.com/alvinvarghese/MyProject.git' invece di' https: // github.com/alvinvarghese/MyProject'? – Larme

+0

@Larme Spiacente, questo è stato un errore di battitura quando ho scritto la domanda. In realtà ha suffisso .git nel file podspec. Grazie per avermelo fatto notare, ho aggiornato la domanda. –

+0

Il repository Github ha un tag "0.1.0"? –

risposta

4

Sembra che abbia dimenticato di includere una definizione source_files (o vendored_frameworks se si sta creando un pod closed-source). Si dovrebbe aggiungere una linea come la seguente al vostro podspec:

s.source_files = "MyProject/**/*.{h,m}" 

Vedi this per un esempio di un podspec di lavoro minimo.

+0

Fammi controllare, dammi un secondo. –

+0

Ho aggiunto la riga sopra, alcuni nuovi errori sono arrivati. –

+0

- ERRORE | Pattern di file [iOS]: il pattern 'source_files' non corrisponde a nessun file. - ERRORE | Pattern di file [iOS]: il pattern 'public_header_files' non corrisponde a nessun file. –