AdMob causing build errors (SOLVED)

After adding admob extension I get build errors. I’m using latest defold and admob.


Open game.projectAndroid and set Minimum SDK Version to 19

I still get build errors. Minimum Sdk 19 and Target Sdk 33.

DO you use custom AndroidManifest.xml specified in game.project or maybe some other extensions with AndroidManifest in it?

I’m using the following

dependencies#0 = https://github.com/britzl/defold-orthographic/archive/refs/tags/3.2.1.zip
dependencies#1 = https://github.com/britzl/gooey/archive/refs/tags/10.4.1.zip
dependencies#2 = https://github.com/subsoap/defsave/archive/refs/tags/v1.2.4.zip
dependencies#3 = https://github.com/defold/lua-language-server/releases/download/v0.0.3/release.zip
dependencies#4 = https://github.com/defold/extension-gpgs/archive/refs/tags/3.0.0.zip
dependencies#5 = https://github.com/defold/extension-admob/archive/refs/tags/3.0.1.zip
dependencies#6 = https://github.com/defold/extension-iap/archive/refs/tags/5.0.1.zip

Builds fine without admob extension

You didn’t answer if you use custom android manifest.

I’m using builtin manifest with additions regarding icons. Only lines added are these

        {{#has-icons?}}
		android:icon="@mipmap/ic_launcher"
		android:roundIcon="@mipmap/ic_launcher_round"
        {{/has-icons?}}

the most important part is


here it takes minSdkVersion from game.project

Here’s the full AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        package="{{android.package}}"
        android:versionCode="{{android.version_code}}"
        android:versionName="{{project.version}}"
        android:installLocation="auto">

    <uses-feature android:required="true" android:glEsVersion="0x00020000" />
    <uses-sdk android:minSdkVersion="{{android.minimum_sdk_version}}" android:targetSdkVersion="{{android.target_sdk_version}}" />
    <application
        {{#has-icons?}}
		android:icon="@mipmap/ic_launcher"
		android:roundIcon="@mipmap/ic_launcher_round"
        {{/has-icons?}}
        android:label="{{project.title}}" android:hasCode="true"
        android:name="android.support.multidex.MultiDexApplication"
        android:debuggable="{{android.debuggable}}">

        <meta-data android:name="android.max_aspect" android:value="2.1" />
        <meta-data android:name="android.notch_support" android:value="true"/>

        <activity android:name="com.dynamo.android.DefoldActivity"
                android:label="{{project.title}}"
                android:configChanges="fontScale|keyboard|keyboardHidden|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
                android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
                android:screenOrientation="{{orientation-support}}"
                android:exported="true"
                android:launchMode="singleTask">
            <meta-data android:name="android.app.lib_name"
                    android:value="{{exe-name}}" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

</manifest>
<!-- END_INCLUDE(manifest) -->

ah, I see now
it looks like a really strange bug with default values.

Please change min version to 21, then unselect this field, then set version to 19 manually (not by clicking reset) and it should work.
I’ll take a look why it’s happening

So, you should have 19 with this button active like this :
image

I changed the sdk versions and made sure they are present in game.project, but now its giving me huge amount of errors/warnings. Heres the log file if it helps.

log.txt (217.6 KB)

Okay its giving those errors/warnings when using builtin proguard config. Now build succeeded.

1 Like

please remove Pro Guard config

So I cant use proguard anymore? It’s highly recommended in Google Play Console.

Only if you carefully setup proguard file that fits for your project
We didn’t update it for a while, so this feature needs a big revision.

2 Likes

Okay I’ll disable it for now

1 Like