airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
201 stars 11 forks source link

Need Assistance With Adobe AIR Project For Android #3131

Open vinodh143 opened 6 months ago

vinodh143 commented 6 months ago

Problem Description

We are encountering the below error while creating the Android package.

Zip file '/private/var/folders/1_/f9053_sd4nqgrznxqjf8dgfr0000gn/T/347f3311-5dc4-4f28-ac2e-a91f1415451d/app/build/outputs/apk/release/app-release.apk' already contains entry 'AndroidManifest.xml', cannot overwrite

We have attached the full error log with this issue. Below are the configurations we are using to create the APK:

Java Version: 11 HarmanAirSDK: 50.2.4.4 Gradle Version: 7.0 Android Target SDK: 33 Android Build Tool: 33.0.0 Build Type: release Log File: adt.log We are stuck and not able to proceed. Could you help us find a solution?

ajwfrost commented 6 months ago

Hi

I think the first step here would be to set up your build so that, instead of using the temp folder for the gradle build, it uses a specific location and leaves the files there afterwards. So could you please edit your ~/.airsdk/adt.cfg file to uncomment/add a line KeepAndroidStudioOutput=true (or use AIR SDK Manager and select "Keep Android Studio output")

Then after you build next, you'll find a folder hopefully alongside your SWF file called "AndroidStudioProject", and if you then open Android Studio you can select this folder to open.

If you then build within Android Studio (build menu "Make Project") it would be likely that you see the same error. Some suggestions on how to fix it are then mentioned here: https://stackoverflow.com/questions/70467985/after-upgraded-to-androidx-zip-file-already-contains-entry-androidmanifes

It's probably worth double-checking that you only have one "AndroidManifest.xml" file in the whole folder tree there... but assuming that's okay, I would suggest trying to add to your "build.gradle" file (that's under the "app" folder):

    packagingOptions {
        exclude 'resources.arsc'
        exclude 'AndroidManifest.xml'
       }

which can go immediately after the android { line

If that then works:

thanks

vinodh143 commented 6 months ago

Hi Andrew,

I apologize for the delay in responding. We encountered numerous issues while attempting to build the project. However, I followed your guidance, and we've finally succeeded in generating the release APK after resolving several Android-related issues. Unfortunately, we've encountered a new challenge as the app is crashing upon launch, prompting further investigation.

I've made the following observations:

Our project is an Adobe Air project utilizing ActionScript 3.0. Despite this, we've faced issues when attempting to create a build using Ant and ADT commands. By unlocking KeepAndroidStudioOutput=true in the adt.cfg file, we managed to obtain an Android Studio project. Within this project, we addressed the Android-related issues and successfully generated the APK, thanks to your invaluable suggestions.

However, we've noticed that the original source code is missing within the Android Studio project. This poses a challenge, particularly when integrating new ANEs. Do you have any insights on how to effectively handle this situation?

Your assistance has been invaluable throughout this process, and I greatly appreciate your continued support.

Best regards, Vinodh.b

marchbold commented 6 months ago

Would recommend you use the Android studio project to locate the rogue AndroidManifest.xml file and try to remove that from your AIR sources.

vinodh143 commented 6 months ago

Hi Michael, There is no AndroidManifest.xml in. our Air Project, i have completely searched, looks like this is been created from some ANE's while building the APK, which is very difficult to identify, even using Android Studio Project.

marchbold commented 6 months ago

You should be able to search the file system in the android studio project and locate any AndroidManifest.xml files. If you can list them here I can help identify the culprit. What ANE's are you using?

vinodh143 commented 6 months ago

Hi Michael,

Below are the List Of ANE's we are currently using

androidx.appcompat.ane androidx.browser.ane androidx.cardview.ane androidx.core.ane androidx.emoji2.ane androidx.vectordrawable.ane com.android.installreferrer.ane com.distriqt.Bolts.ane com.distriqt.Core.ane com.distriqt.facebook.Core.ane com.distriqt.facebook.GamingServices.ane com.distriqt.facebook.Login.ane com.distriqt.facebook.Share.ane com.distriqt.InAppBilling.ane com.google.code.gson.ane com.jetbrains.kotlin.ane DataShare.ane Among the list, only DataShare.ane is not part of Distriqt.

And with respect to AndroidManifest.xml, i can see around 70 such xml's in AndroidStudio project, below are the list

AndroidStudioProject/com.facebook.share/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.appcompat.resources/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.viewpager2/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.browser/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.cardview/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.core/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.viewpager2/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/com.distriqt.extension.core/src/main/AndroidManifest.xml
AndroidStudioProject/com.facebook.common/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/com.facebook.common/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.activity/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.activity/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.coordinatorlayout/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.browser/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.core/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.viewpager2/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/com.facebook.share/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.coordinatorlayout/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.activity/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2.viewsintegration/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2.widget/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.appcompat.resources/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.media/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.cardview/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.coordinatorlayout/src/main/AndroidManifest.xml
AndroidStudioProject/com.distriqt.extension.bolts/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.fragment/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.lifecycle.viewmodel/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/com.facebook.common/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.appcompat.resources/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.media/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.drawerlayout/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.drawerlayout/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.lifecycle.viewmodel/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/app/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.startup/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2.viewsintegration/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.startup/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.media/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.core/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.lifecycle.runtime/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.fragment/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.appcompat/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/com.distriqt.extension.bolts/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.appcompat/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/com.facebook.login/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2.viewsintegration/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.cardview/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/com.facebook.share/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.lifecycle.viewmodel/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.fragment/src/main/AndroidManifest.xml
AndroidStudioProject/com.facebook.login/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/com.distriqt.extension.core/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.startup/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.drawerlayout/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/app/build/intermediates/merged_manifests/release/AndroidManifest.xml
AndroidStudioProject/app/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.browser/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.lifecycle.runtime/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/com.distriqt.extension.core/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2.widget/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/androidx.emoji2.widget/build/intermediates/aapt_friendly_merged_manifests/release/aapt/AndroidManifest.xml
AndroidStudioProject/androidx.appcompat/src/main/AndroidManifest.xml
AndroidStudioProject/androidx.lifecycle.runtime/src/main/AndroidManifest.xml
AndroidStudioProject/com.facebook.login/build/intermediates/merged_manifest/release/AndroidManifest.xml
AndroidStudioProject/app/build/intermediates/packaged_manifests/release/AndroidManifest.xml
AndroidStudioProject/com.distriqt.extension.bolts/build/intermediates/merged_manifest/release/AndroidManifest.xml

if you want physical files, i can zip and attach that too, please let me know

Thanks & Regards

vinodh143 commented 5 months ago

Hi @marchbold Would you help me finding ANE causing the issue?, i am kind of stuck here.

marchbold commented 5 months ago

Nothing stands out there. Feel free to send me your Android studio project folder and I'll have a look through it. (airnativeextensions @ distriqt.com)

marchbold commented 5 months ago

@vinodh143 That project worked fine for me. Perhaps try a clean AIR SDK or Android Studio install and check that your Android sdk is updated. The random manifest file might be there somewhere?

vinodh143 commented 5 months ago

@marchbold , yes that androidstudio project initially has lots of issues, but i have resolved one by one and i have followed the stpes provided by Andrew packagingOptions { exclude 'resources.arsc' exclude 'AndroidManifest.xml' } only after i was able to generate the apk, but the apk is still stucks at loading screen, and the main Air project i am still facing issue Zip file '/private/var/folders/1_/f9053_sd4nqgrznxqjf8dgfr0000gn/T/347f3311-5dc4-4f28-ac2e-a91f1415451d/app/build/outputs/apk/release/app-release.apk' already contains entry 'AndroidManifest.xml', cannot overwrite And every time when i tries to create build by running ADT command, the changes i made to AndroidStudio project will be gone, as the whole folder delete and recreate,(for the safer side, i took a copy of it, even the folder whihc i send you has all my changes) so it was very tough to add any new UI to the game. So instead of the sending the AndroidStudio project which has my changes, do i need to send the fresh AndroidStudio Project created?.

marchbold commented 5 months ago

Ah okay, could you send me the failing build then and I'll see if I can locate the issue.