tuarua / AdMob-ANE

AdMob Adobe Air Native Extension for iOS 10.0+, Android 19+. Supports Banner, Interstitial and RewardVideo ads
Apache License 2.0
28 stars 8 forks source link

Exception while crating .aab build #44

Open bobrokrol opened 3 years ago

bobrokrol commented 3 years ago

Helllo, I did not have any issues creating .apk. But when I tried to create .aab I got this error .aab is required since august in google play for new apps and will be required for updates soon

Warning: Using default implementation for native extension 'com.tuarua.FreSwift'
NOTE: Multiple Android build-tools folders exist, choosing the latest version (30.0.2) for packaging
unexpected failure: Unable to run java: com.adobe.air.ADTException: gradle tool failed:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':androidx.coordinatorlayout-coordinatorlayout:generateReleaseRFile'.
> A failure occurred while executing com.android.build.gradle.internal.res.GenerateLibraryRFileTask$GenerateLibRFileRunnable
   > Package 'androidx.coordinatorlayout-coordinatorlayout' from AndroidManifest.xml is not a valid Java package name as 'coordinatorlayout-coordinatorlayout' is not a valid Java identifier.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

java.io.IOException: Unable to run java: com.adobe.air.ADTException: gradle tool failed:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':androidx.coordinatorlayout-coordinatorlayout:generateReleaseRFile'.
> A failure occurred while executing com.android.build.gradle.internal.res.GenerateLibraryRFileTask$GenerateLibRFileRunnable
   > Package 'androidx.coordinatorlayout-coordinatorlayout' from AndroidManifest.xml is not a valid Java package name as 'coordinatorlayout-coordinatorlayout' is not a valid Java identifier.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

        at com.adobe.air.apk.AABOutputStream.buildGradle(AABOutputStream.java)
        at com.adobe.air.apk.AABPackager.renameOutput(AABPackager.java)
        at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java)
        at com.adobe.air.apk.AABPackager.createPackage(AABPackager.java)
        at com.adobe.air.ADT.parseArgsAndGo(ADT.java)
        at com.adobe.air.ADT.run(ADT.java)
        at com.adobe.air.ADT.main(ADT.java)

my android app xml part

 <android>

            <manifestAdditions><![CDATA[
            <manifest android:installLocation="auto">
                             <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
                             <uses-permission android:name="android.permission.WAKE_LOCK"/>
                 <uses-permission android:name="android.permission.RECORD_AUDIO"/>
                 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
                 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
                 <uses-permission android:name="android.permission.INTERNET"/>
                <uses-permission android:name="com.android.vending.BILLING" />
                <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />

                <application android:enabled="true">

                       <activity
                            android:excludeFromRecents="false" android:hardwareAccelerated="true">
                            <intent-filter>
                                <action android:name="android.intent.action.MAIN"/>
                                <category android:name="android.intent.category.LAUNCHER"/>
                            </intent-filter>
                        </activity>

                        <activity
                             android:name="com.google.android.gms.ads.AdActivity"
                             android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
                             android:theme="@android:style/Theme.Translucent" />
                        <meta-data android:name="android.max_aspect" android:value="2.1" />

                       <meta-data
                            android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>

                       <meta-data
                            android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT"
                            android:value="true"/>
                       <meta-data
                                 android:name="com.google.android.gms.ads.APPLICATION_ID"
                                 android:value="ca-app-pub-2257021738713951~9432865910"/>

                       <meta-data
                        android:name="com.google.android.play.billingclient.version"
                        android:value="3.0.2" />
                           <activity
                        android:name="com.android.billingclient.api.ProxyBillingActivity"
                        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
                        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

                </application>
            </manifest>

        ]]></manifestAdditions>

        <containsVideo>true</containsVideo>
    </android>

    <extensions>
        <extensionID>com.tuarua.InAppPurchaseANE</extensionID>
        <extensionID>com.tuarua.frekotlin</extensionID>
        <extensionID>com.google.code.gson.gson</extensionID>
        <extensionID>androidx.legacy.legacy-support-v4</extensionID>
        <extensionID>com.android.billingclient.billing-ktx</extensionID>
        <extensionID>org.jetbrains.kotlinx.kotlinx-coroutines-android</extensionID>
        <extensionID>com.tuarua.FreSwift</extensionID>

        <extensionID>com.tuarua.AdMobANE</extensionID>
        <extensionID>com.google.android.gms.play-services-measurement</extensionID>
        <extensionID>com.google.android.gms.play-services-base</extensionID>
        <extensionID>com.google.android.gms.play-services-ads-lite</extensionID>
        <extensionID>com.google.android.ump.user-messaging-platform</extensionID>

    </extensions>
tuarua commented 3 years ago

There seems to be a problem with the dashes in packagedResource.platformName in platform.xml of an ANE when compiling for AAB. This only affects some companion ANEs.

  1. You will need to update to use latest ANEs (see latest sample Main.xml) https://github.com/tuarua/AdMob-ANE/blob/master/example/src/Main-app.xml Ideally you are using air-tools via the air_package.json https://github.com/tuarua/AdMob-ANE/blob/master/example/air_package.json N.B. this is not the same as apm from airsdk GitHub. I introduced mine 1 year ago as a way to easily install ANEs with required manifest entries, companion extensions etc.

  2. I have updated the 2 offending ANEs at https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/support/androidx.legacy.legacy-support-v4-1.0.0.ane?raw=true https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/support/androidx.room.room-runtime-2.3.0.ane?raw=true

I have now built an AAB with these updated ANEs and it now builds successfully

bobrokrol commented 3 years ago

There seems to be a problem with the dashes in packagedResource.platformName in platform.xml of an ANE when compiling for AAB. This only affects some companion ANEs.

  1. You will need to update to use latest ANEs (see latest sample Main.xml) https://github.com/tuarua/AdMob-ANE/blob/master/example/src/Main-app.xml Ideally you are using air-tools via the air_package.json https://github.com/tuarua/AdMob-ANE/blob/master/example/air_package.json N.B. this is not the same as apm from airsdk GitHub. I introduced mine 1 year ago as a way to easily install ANEs with required manifest entries, companion extensions etc.

I have updated the 2 offending ANEs at https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/support/androidx.legacy.legacy-support-v4-1.0.0.ane?raw=true https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/support/androidx.room.room-runtime-2.3.0.ane?raw=true

I have now built an AAB with these updated ANEs and it now builds successfully

Thank you very much, I wil try

bobrokrol commented 3 years ago

I just downloaded latest AdMob-ANE-3.1.0 release run airtools install

Downloading: https://github.com/tuarua/AdMob-ANE/releases/download/3.1.0/AdMobANE.ane?raw=true to AppData folder
Using cached AppData version of com.tuarua.AdMobANE version 3.1.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/kotlin/com.tuarua.frekotlin-1.42.0.ane?raw=true to AppData folder
Using cached AppData version of com.tuarua.frekotlin version 1.42.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/misc/com.google.code.gson.gson-2.8.6.ane?raw=true to AppData folder
Using cached AppData version of com.google.code.gson.gson version 2.8.6
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/support/androidx.legacy.legacy-support-v4-1.0.0.ane?raw=true to AppData folder
Using cached AppData version of androidx.legacy.legacy-support-v4 version 1.0.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/support/androidx.room.room-runtime-2.3.0.ane?raw=true to AppData folder
Using cached AppData version of androidx.room.room-runtime version 2.3.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/support/androidx.sqlite.sqlite-framework-2.1.0.ane?raw=true to AppData folder
Using cached AppData version of androidx.sqlite.sqlite-framework version 2.1.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/support/androidx.work.work-runtime-2.5.0.ane?raw=true to AppData folder
Using cached AppData version of androidx.work.work-runtime version 2.5.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/play-services/com.google.android.gms.play-services-measurement-19.0.0.ane?raw=true to AppData folder
Using cached AppData version of com.google.android.gms.play-services-measurement version 19.0.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/play-services/com.google.android.gms.play-services-base-17.6.0.ane?raw=true to AppData folder
Using cached AppData version of com.google.android.gms.play-services-base version 17.6.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/play-services/com.google.android.gms.play-services-ads-lite-20.2.0.ane?raw=true to AppData folder
Using cached AppData version of com.google.android.gms.play-services-ads-lite version 20.2.0
Downloading: https://github.com/tuarua/Android-ANE-Dependencies/blob/master/anes/play-services/com.google.android.ump.user-messaging-platform-1.0.0.ane?raw=true to AppData folder
Using cached AppData version of com.google.android.ump.user-messaging-platform version 1.0.0
Downloading: https://github.com/tuarua/Swift-IOS-ANE/releases/download/5.2.0/ios_dependencies.zip to AppData folder
Using cached AppData version of com.tuarua.iOS.FreSwift version 5.2.0
Downloading: https://github.com/tuarua/AdMob-ANE/releases/download/3.1.0/ios_dependencies.zip?raw=true to AppData folder
Using cached AppData version of com.tuarua.AdMobANE.IosDependencies version 3.1.0
Merging Manifests
Updating App Descriptor XML with Manifest Additions

I have tried AIRSDK_Windows_33.1.1.217 AIRSDK_Windows_33.1.1.575

and I got an error:

aapt tool failed:C:\Users\Lenovo\AppData\Local\Temp\7a6eef14-9b4c-47a3-9eab-c8c6a5770d46\androidx.lifecycle-lifecycle-viewmodel-2.3.0-res\values\values.xml:3: error: Found tag id where item is expected
C:\Users\Lenovo\AppData\Local\Temp\7a6eef14-9b4c-47a3-9eab-c8c6a5770d46\androidx.lifecycle-lifecycle-runtime-2.3.0-res\values\values.xml:3: error: Found tag id where item is expected
tuarua commented 3 years ago

I am not seeing the same, tho I am building on macOS. I am using Android Build Tools 30.0.3 and java 1.8

From what I can find, this is related to aapt2 https://github.com/sthewissen/Xamarin.Forms.PancakeView/issues/131 https://github.com/sthewissen/Xamarin.Forms.PancakeView/issues/153

You may try raising your minSdkVersion to 21 <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />

You may need to raise this on Adobe Runtime Support https://github.com/airsdk/Adobe-Runtime-Support/issues?q=is%3Aissue+aab