Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

"Unfortunately, Adobe Viewer has stopped" (AEMM Tool Android Emulator issue)

Avatar

Level 1

Hi, I am trying to build custom Cordova plugins into an AEM mobile application and while my build and deployment works perfectly fine on iOS, I am having endless trouble getting it to work on Android at all.

I must clarify, I didn't have this problem in my first build, but shortly after adding the aemm Cordova plugins, my builds on Android ceased working. Further, the build process goes perfectly. I haven't been thrown any errors except for the one listed in the subject.

The error occurs when I attempt to run the app in the emulator for testing purposes, or when I try to upload the APK as a custom shell to rebuild the AEM application.

I haven't been able to find any related information yet, and including custom plugins is crucial to a module we are trying to include at our clients' request.

At first I suspected something may be wrong with my build so I created a fresh project and did not include any plugins and received the same result.

Next, thinking that something may have been corrupted I removed all traces of Android Studio and the AEM tool, all SDK's, and updated Node and NPM to be sure. I then reinstalled and recreated a project, strictly following the instructions in the docs and received the same result.

As a last resort I attempted to do a fresh build on another Mac. The other computer had never had any related tools installed previously, so installed per Adobe's instructions again. And again without, followed by with, the plugins required. Both times failed with the same error.

After running aemm run android I only receive (in terminal):

Success

starting app server...

Use Ctrl-C to exit

listening on 10.10.114.154:3000

listening on 10.10.118.23:3000

Starting: Intent { cmp=com.adobe.dps.viewer/.collectionview.CollectionActivity (has extras) }

200 '/articles.json'

200 '/articles.json'

TL;DR: My Android builds are not working and throwing the error in the subject. I had it working prior to installing the standard bunch of aemm plugins, and it works on iOS without a problem. I need help getting this working as we require a few custom plugins for a module being included in HTML articles.

android_fail-2.pngandroid_fail.png

7 Replies

Avatar

Level 1

Can you provide us the exact set of commands leading to this error?

Commands between "aemm project create [project_name]" and "aemm run android"

Thanks

Henry

Avatar

Level 1

Up until I ran the following everything worked:

aemm plugin add aemm-plugin-application aemm-plugin-user aemm-plugin-context aemm-plugin-device aemm-plugin-inappbrowser aemm-plugin-fullscreen-video aemm-plugin-navto aemm-plugin-html-contract
aemm plugin add https://github.com/adobe-marketing-cloud-mobile/cordova-plugin-wkwebview-engine.git#2.0.0
aemm plugin add cordova-plugin-camera cordova-plugin-compat cordova-plugin-contacts cordova-plugin-device cordova-plugin-device-motion cordova-plugin-device-orientation cordova-plugin-dialogs cordova-plugin-file cordova-plugin-file-transfer cordova-plugin-geolocation cordova-plugin-globalization cordova-plugin-media cordova-plugin-media-capture cordova-plugin-network-information cordova-plugin-vibration

It was after this that I ran the these commands to find it failing:

aemm build android
aemm run android


Since those plugins, I tried removing them to no avail. I tried starting fresh projects and adding no plugins to no avail, as such:

aemm project create [project]

aemm platform add android

aemm build android

aemm run android


Each command ran without error, on both systems I tested. It would work prior to adding the standard plugin set (I even used custom plugins in the first build prior to adding the standard set), and would fail afterward. Then no matter what I do I haven't been able to see any change in the result.

Thanks for your looking into this, Henry.

Avatar

Level 1

Thanks, your info helped.

I have narrowed down the problem and am working on the fix. I will try to get the fix in our next release, tentatively scheduled for next week. I will keep you posted when the release is available.

For now, here is a workaround:

1. Download an older version of aemm-lib-release.aar from:

https://github.com/adobe-marketing-cloud-mobile/aemm-android/blob/830be0376fc456c020258f0ff37b81d00f...

2. Replace the aemm-lib-release.aar in [your_project]/platforms/android/libs with the one downloaded above

3. Rebuild the whole project "aemm build android"

Let me know if you have additional questions.

Thanks

Henry

Avatar

Level 1

Hi Henry,

Your solution worked perfectly when building for the emulator, however I'm still facing an error when I attempt to build an Android app in the On-Demand Portal, using the newly built shell.

My process for the failed release build was:

  1. Replace the aemm library aar file.
  2. Run `aemm build android --release`. Apk builds successfully.
  3. Upload as custom shell & assign a name. Uploads successfully.
  4. Clicking "Submit" submits the app (showing me the success dialog), returns me to the app list and beings building.
  5. After a minute or so it informs me that the build has failed.

The only error message available to me is displayed when I hover over the "Failed" icon, which says:

"Unable to build the app. Try again."

I appreciate your help here

Avatar

Level 1

Hi Henry,

I was wondering -- have there been any updates? Otherwise do you happen to have an updated schedule for your next release so I can forward an approximate date? I've kept an eye on Github but haven't seen anything.

Thanks again

Avatar

Level 1

Hi,

We just pushed the fix to the git repository, please give it a try and let us know whether it fixed the issue.

I didn't see your new issue posted on 11/18 till today. The issue appears to be related to the AppBuilder. Since the aar(I suggested for the workaround) was quite old, it's likely it is no longer compatible with the latest AppBuilder.

Thanks

Henry

Avatar

Employee

Hi Robert, I tried the steps that you outlined above with the latest release of the AEMM tool and was not able to reproduce the problem. Can you try updating to the latest?