Cannot import com.google.android.gms:play-services-ads:17.1.1

前端 未结 3 849
滥情空心
滥情空心 2020-12-11 12:12
apply plugin: \'com.android.application\'
   android {
   compileSdkVersion 28

   defaultConfig {
      applicationId \"com.kaiboon0216gmail.homeownerstarterkit\"
          


        
相关标签:
3条回答
  • 2020-12-11 12:23

    Go to Admob - Select App - App Setting - App ID copy the value from App ID

    Now add this (change this android:value="paste the App ID value you copy from your admob app" )

    <meta-data
                android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="ca-app-pub-111100000000~1111111"/>
    

    meta-data into AndroidManifest.xml file

    No need to add anything in APPLICATION_ID from android:name="com.google.android.gms.ads.APPLICATION_ID"

    This will work!

    See the picture below for clear understanding

    0 讨论(0)
  • 2020-12-11 12:26

    Because with "com.google.android.gms:play-services-ads:17.1.1" You need to update something.

    You have to Update your AndroidManifest.xml

    <manifest>
        <application>
            <meta-data
                android:name="com.google.android.gms.ads.AD_MANAGER_APP"
                android:value="true"/>
        </application>
    </manifest>
    

    And with this:

    <manifest>
        <application>
            <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
            <meta-data
                android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="[ADMOB_APP_ID]"/>
        </application>
    </manifest>
    

    You can check these links for more detail informations.

    https://developers.google.com/ad-manager/mobile-ads-sdk/android/quick-start#update_your_androidmanifestxml

    https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml

    Otherwise You have to use "com.google.android.gms:play-services-ads:16.0.0"

    0 讨论(0)
  • 2020-12-11 12:39

    Use "com.google.android.gms:play-services-ads:16.0.0", the new 17.1.1 change some code implementation, ie, you need do that in ur source too, or back to 16.0.0 for now...

    will fix your error for while...

    0 讨论(0)
提交回复
热议问题