Erreur "Bibliothèque introuvable pour" après l'installation de l'application dans AdMob

StackOverflow https://stackoverflow.com//questions/24050012

  •  21-12-2019
  •  | 
  •  

Question

Je reçois une erreur après avoir déposé ma candidature dans AdMob.L'application fonctionnait jusqu'à aujourd'hui.L'erreur est la suivante :

ld: library not found for -lGoogleAdMobAds
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Comment puis-je réparer cela?Merci.

Était-ce utile?

La solution

Parfois, vous supprimez simplement la référence de la bibliothèque et ajoutez à nouveau une référence.

En dehors de l'ajout du SDK Google Mobile Ads et d'autres bibliothèques à partir de zéro, je vous recommanderais de vérifier les chemins de recherche bibliothèque .Il y a des instances lorsque vous copiez ou dupliquez une cible, Xcode décide qu'il doit échapper à des citations doubles »avec un '\'. Assurez-vous de supprimer tout ce qui devrait ressembler à ceci -

Entrez la description de l'image ici

J'ai pu dupliquer l'erreur en préfixant mon chemin avec plusieurs '\'.

Autres conseils

J'ai eu un problème similaire de "bibliothèque introuvable".Cependant, c'était parce que j'utilisais accidentellement le .xcodeproj fichier au lieu du .xcworkspace déposer.

Sélectionnez votre cible, allez sur "Build Phases" dans "Link Binary With Libraries" retirer ".a" fichier de cette bibliothèque.Nettoyer et construire.

Si une erreur liée aux cocoapodes suivez:

library not found for -lPod-...

Vous devez vérifier d'autres drapeaux de liaison et retirez-le de là.

Informations supplémentaires: Si vous avez un ancien projet utilisant des cocoapodes.Et récemment, vous devez ajouter le user_frameworks! à votre podfile. Les cocoapodes n'ajouteront pas les bibliothèques à vos autres drapeaux de liaison plus parce que son hérité.Par conséquent, vous devrez peut-être supprimer ces manuellement des autres drapeaux de liaison qu'ils ont été ajoutés avant en utilisant l'utilisation_frameworks!

Pour mon cas Xcode7, a également travaillé dans Xcode 9.1

ld: library not found for -ldAfnetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)

ensemble Build Active architecture Only à Yes

enter image description here

Si une erreur est comme suit

ld: bibliothèque introuvable pour -lpods

J'ai trouvé qu'un fichier "libpods.a" qui est en couleur rouge (comme des fichiers manquants) a été créé d'une manière ou d'une autre dans le groupe-cadre du projet.Je viens de simplement supprimer ce fichier et tout a fini.

EDIT: une autre solution

Une autre solution que j'ai déjà répondu dans la question similaire est dans Ce lien

Cela se produit si vous utilisez des cocoapodes et n'utilisez pas le .xcworkspace fichier au lieu du fichier par défaut .xcodeproj déposer.

goto Phases de construction -> Link binaire avec des bibliothèques et supprimer la bibliothèque qui montrent les erreurs car cette bibliothèque n'est pas disponible dans le dossier de projet

Cela peut également se produire si vous ouvrez un fichier de projet au lieu d'un espace de travail.J'ai perdu une journée de cette façon.

en retard pour la réponse, mais voici la liste des choses que j'ai essayées. Ce sera au même endroit si quelqu'un veut essayer de résoudre le problème.

  1. architecture valide= armv7 armv7s
  2. Construire une architecture active uniquement= NO
  3. cible -> Paramètres de construction -> Autres indicateurs de liaison= $ (hérité)
  4. Cible -> Paramètres de construction -> Path de recherche de la bibliothèque= $ (hérité)
  5. Produit Nettoyer
  6. Mise à jour de la pod dans le terminal

In my case there was a naming issue. My library was called ios-admob-mm-adapter.a, but Xcode expected, that the name should start with prefix lib. I've just renamed my lib to libios-admob-mm-adapter.a and fixed the issue.

I use Cocoapods, and it links libraries with Other linker flags option in build settings of my target. The flag looks like -l"ios-admob-mm-adapter"

Hope it helps someone else

Simply, GoogleAdMobAds.a is missing in project target. For me it was libAdIdAccessLibrary.a Please check attached screenshot

enter image description here

As for me this problem occurs because i installed Material Library for IOS. to solve this issue

1: Go to Build Settings of your target app.

2: Search for Other linker flags

3: Open the other linker flags and check for the library which is mention in the error.

4: remove that flag.

5: Clean and build.

I hope this fix your issue.

I know this is a bit old, but I just hit a similar issue and running 'pod update' fixed this for me. My library error was with AFNetworking...

Just be careful doing pod update if you don't use explicit versions in your pod file.

This error is very weird.

I had this error with -ldAfnetworking and I only copy my project in other path and works.

I tried renaming my build configuration Release to Production, but apparently cocoa pods doesn't like it. I renamed it again to Release, and everything builds just fine.

@raurora's answer pointed me in the right direction. I was including libraries in my "watchkitapp Extension/lib" path. In this case, the Library Search Path needed to be escaped with a '\', but the linker didn't seem to understand this. To fix / work-around the issue, I moved my lib path up one level so it was no longer in a directory that contained a space in the name.

I just update the pod file 'pod update' and it start to work for me normally.

Running 'pod update' in my project fixed my problem with the 'library not found for -lSTPopup' error.

Remarking Trevor Panhorst's answer:

"Just be careful doing pod update if you don't use explicit versions in your pod file."

Easy solution. Here's how I'd fix the issue:

  1. Go to the directory platforms/ios
  2. Then, execute the command pod install

That's it. This should install the missing library.

In the case of ld: library not found for -{LIBRARY_NAME} happened because the library file(s) is not existing.

Check the library path on your application targets’ “Build Phases” Library Search Paths tab.

The library file(s) path must be according to the real path for example if your file(s) in the root of the project you must set the path like $(PROJECT_DIR)

It is compile time error for a Static Library that is cased by Static Linker

ld: library not found for -l<Library_name>

You can get the error Library not found for when you have not include a library path to the Library Search Paths

ld means Static Linker which can not find a location of the library. As a developer you should help the linker and point the Library Search Paths

Build Settings -> Search Paths -> Library Search Paths 
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top