خطأ "لم يتم العثور على مكتبة لـ" بعد وضع التطبيق في AdMob

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

  •  21-12-2019
  •  | 
  •  

سؤال

تظهر لي رسالة خطأ بعد أن أضع طلبي في AdMob.التطبيق كان يعمل حتى اليوم.الخطأ هو ما يلي:

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

كيف يمكنني اصلاح هذا؟شكرًا لك.

هل كانت مفيدة؟

المحلول

في بعض الأحيان يمكنك فقط إزالة مرجع المكتبة وإضافة مرجع مرة أخرى.

بصرف النظر عن إضافة إعلانات Google Mobile SDK والمكتبات الأخرى مرة أخرى من الصفر، أود أن أوصي بتحقق من مسارات البحث Library .هناك مثيلات عند نسخ أو تكرار هدف، تقرر Xcode أنه يحتاج إلى الهروب من أي اقتباسات مزدوجة "مع" \ ". تأكد من إزالة كل شيء - يجب أن تبدو مثل هذا -

أدخل وصف الصورة هنا

كنت قادرا على تكرار الخطأ، عن طريق القيام بادئة مساري مع "\" متعددة.

نصائح أخرى

واجهت مشكلة مماثلة "لم يتم العثور على المكتبة".ومع ذلك كان ذلك لأنني كنت أستخدم عن طريق الخطأ .xcodeproj الملف بدلاً من .xcworkspace ملف.

حدد هدفك، اذهب إلى "Build Phases" في "Link Binary With Libraries" يزيل ".a" ملف تلك المكتبة.نظيفة وبناء.

إذا كان الخطأ يتعلق بـ Cocoapods على النحو التالي:

library not found for -lPod-...

تحتاج إلى التحقق أعلام رابط أخرى وإزالته من هناك.

معلومات اضافية: إذا كان لديك مشروع قديم يستخدم الكاكاوبودات.ومؤخرًا كنت بحاجة إلى إضافة ملف use_frameworks! إلى ملف podfile الخاص بك.لن تضيف Cocoapods المكتبات إلى أعلام الرابط الأخرى التي تسبب ورثتها.لذلك ، قد تحتاج إلى إزالة أولئك يدويًا من أعلام الرابط الأخرى التي تمت إضافتها قبل استخدام use_frameworks!

لحالتي اكس كود 7, ، كما عملت في اكس كود 9.1

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

تعيين Build Active architecture Only ل Yes

enter image description here

إذا كان الخطأ يشبه التالية

LD: لم يتم العثور على مكتبة ل -LPods

وجدت أن ملف "libpods.a" الذي هو باللون الأحمر (مثل الملفات المفقودة) تم إنشاؤه بطريقة أو بأخرى في المجموعة الإطارية للمشروع.أنا ببساطة أزلت هذا الملف وكل شيء على ما يرام.

تحرير: حلا آخر

حلا آخر قد أجبت بالفعل في سؤال مماثل موجود في هذا الرابط

يحدث هذا إذا كنت تستخدم الكاكاو ولا تستخدم .xcworkspace الملف بدلا من الافتراضي .xcodeproj ملف.

goto بناء المراحل -> ربط ثنائي مع المكتبات وإزالة المكتبة التي تظهر الأخطاء لأن تلك المكتبة غير متوفرة في مجلد المشروع

يمكن أن يحدث هذا أيضا إذا قمت بفتح ملف المشروع بدلا من مساحة عمل.لقد أهدرت مثل نفسي بنفس الطريقة.

في وقت متأخر من الإجابة ولكن فيما يلي قائمة الأشياء التي جربتها. ستكون في مكان واحد إذا أراد أي شخص محاولة إصلاح المشكلة.

  1. بنية صالحة= ARMV7 ARMV7S
  2. بناء بنية نشطة فقط= لا
  3. الهدف -> إعدادات بناء -> أعلام روابط أخرى= $ (الموروثة)
  4. الهدف -> إعدادات بناء -> مسار بحث المكتبة= $ (الموروثة)
  5. المنتج نظيفة
  6. تحديث جراب في المحطة

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 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top