• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by Ekta-Mehta-D · Nov 01, 2021 at 08:04 AM · unityeditorfacebookadmobgoogle playruntime-error

Error while using Facebook sdk and google Admob ad plugin

Hello everyone.

I am facing really big problem as i have tried to solve since one week.

I have installed facebook SDK plugin first. Which i was able to run on device. I was able to build apk file easily and Facebook login worked as expected.

Then i added Google admob SDK. Then i set up admob App ID and tried to build apk and i got build error.

 gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease" 
 stderr[ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 D8: Cannot fit requested classes in a single dex file (# methods: 74418 > 65536) com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K.

Then i resolved above error by :

Assets > External Dependancy Manager > Android Resolver > Delete Resolved Libraries.

Then i was able to build apk.

But unfortunately i got runtime error for Facebook sdk :

  java.lang.RuntimeException: Unable to get provider com.facebook.FacebookContentProvider: java.lang.ClassNotFoundException: Didn't find class "com.facebook.FacebookContentProvider" on path: DexPathList[[zip file "/data/app/com.DefaultCompany.CookingMaster-1/base.apk"],nativeLibraryDirectories=[/data/app/com.DefaultCompany.CookingMaster-1/lib/arm, /data/app/com.DefaultCompany.CookingMaster-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
         at android.app.ActivityThread.installProvider(ActivityThread.java:6877)
         at android.app.ActivityThread.installContentProviders(ActivityThread.java:6469)
         at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6409)
         at android.app.ActivityThread.access$1800(ActivityThread.java:229)
         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887)

So please help me to solve this.

I am using Facebook SDk version 11.0.0 and GoogleAdmob version is 6.1.2.

Unity version is 2020.3.21f1.

I am not using any other plugin. i have taken fresh project which only includes Facebook sdk and google admob plugin.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by ATLGAN · Nov 01, 2021 at 08:34 AM

I had this error before too. This is so annoying. There is few solution but these are not quarantee.

1 - Change Minimum API level to Android 5.0 Lollilop.

2 - "Assets/External Dependency Manager/Android Resolver/Force Resolver" try this.

3 - You can try this: https://velog.io/@ymsection/Unity-Android-빌드시-Error-The-Option-Android.Enabler8-Is-Deprecated-blah-blah.

4 - Close the Unity Editor, delete Libray and reopen project.

5 - Open Custom Main Gradle Template and Custom Launcher Gradle Template.

I hope these help you.

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ekta-Mehta-D · Nov 01, 2021 at 11:04 AM 0
Share

Thanks. its working after changing minimum api level

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

139 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Admob+googleplayservices= CommandInvokationFailure: Failed to re-package resources 4 Answers

Error while building; manifest merger failed with multiple errors see logs 1 Answer

IL2CPP Google AdMob problem 0 Answers

Facebook Share Score Link to Google Play 0 Answers

Admob + Google Play Services Error 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges