1

I have a problem with Ionic 3 and Cordova 10/11. I'm trying to build an application with SDK API 32, but when I built it, I got this message:

ConsoleError

When I search about the problem of "android:exported" and the targetting of Android 12, i put all the "android:exported" in the explicit way but the message appear anyway.

I'm building with Gradle 7.1.1, I need to update plugins of the project?

Someone have this kind of problem? Can someone give me a hand?

UPDATE

Here is my Manifest.XML on platforms/android/app/src/main

enter image description here

Eric
  • 9,870
  • 14
  • 66
  • 102
Nicolas Papp
  • 309
  • 2
  • 4
  • 11

1 Answers1

0

(small disclaimer, I know nothing about Ionic, just cordova) I see 3 seperate issues in your logs:

1, you are using 'conpile', where you should be using 'implementation', see this answer: Could not find method compile() for arguments [com.android.support:support-v4:+] It's weird that is a warning and not an error, if you are using gradle 7.1.1 and cordova 10+, but I think you should fix that anyway (it's pretty straigt forward).

2, That plugin version error, not sure what's wrong there, but seems like a separate issue.

3, the logs say that android:exported is still missing in some places. For me the problem was inside a plugin, you have to update/patch those too. I had to do it for the social-sharing plugin and patched it with patch-package. If you cannot find it, can you share your android-manifest.xml? (since the android-manifest is inside the platforms folder changing the file itself wont work as it is rebuild every time you build your app, so you need to change it from the config.xml/hooks/patches, see this answer: How to set Android exported for Cordova application)

I'd target cordova-android 10.1.2 with target sdk 31 first. And upgrade step by step. Otherwise you get too many errors at once.

Mister_CK
  • 668
  • 3
  • 13
  • 1
    I updated the post with de Manifest.xml. I think i have all the android:exported, what do you think? The first step for you is target sdk 31? In that case, i'm going to get that way. – Nicolas Papp Dec 30 '22 at 14:30
  • Thanks for adding the manifest. I don't see any missing android:exported. However, I don't think you need to include it in the tag. Since it is already included in the inside it. (I don't have it there and that works for me). Also, I am not sure about the amazon one. I don't have an 'enable-feature' in my manifest. Other than that I wouldn't know what could still cause the error. Which plugins are you using? – Mister_CK Dec 30 '22 at 15:31
  • Yes, I had to update from target-sdk 29 to 31 and every time a few things break, mostly because a lot of plugins aren't maintained. I believe I still can't build with target-sdk 32 because of new errors. So even if you are building a new app it is probably easier to not target the highest versions of everything (at first) – Mister_CK Dec 30 '22 at 15:34