Android Question Huawei (HMS) Integration requires android exported flag

mcqueccu

Well-Known Member
Licensed User
Longtime User
I am integrating Huawei Services and when compiling I got this error.


B4X:
B4A Version: 12.80
Parsing code.    (0.04s)
    Java Version: 14
Building folders structure.    (0.06s)
Running custom action.    (0.04s)
Running custom action.    (0.03s)
Compiling code.    (0.14s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.26s)
Linking resources    (0.57s)
Compiling debugger engine code.    (0.00s)
Compiling generated Java code.    (0.03s)
Finding libraries that need to be dexed.    (0.01s)
Dex code    (0.61s)
Dex merge    (3.39s)
Copying libraries resources    (1.14s)
ZipAlign file.    (0.06s)
Signing package file (private key).    (0.69s)
Installing file to device.    Error
adb: failed to install HuaweiServices_RAPID_DEBUG.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1919606592.tmp/base.apk (at Binary XML file line #137): com.huawei.hms.support.api.push.PushMsgReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]


Here is my Manifest
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.


#if HMS
CreateResourceFromFile(Macro, hms.hms)
CreateResourceFromFile(Macro, hms.hms_push)
CreateResourceFromFile(Macro, hms.hms_drm)
CreateResourceFromFile(Macro, hms.hms_ads)
SetApplicationAttribute(android:usesCleartextTraffic, "true")
#end if
 

mcqueccu

Well-Known Member
Licensed User
Longtime User
I have added the Jar to my Additional folder to replace the old one but I got the Same Error when using Target SDK 33


B4X:
B4A Version: 12.80
Parsing code.    (0.04s)
    Java Version: 14
Building folders structure.    (0.06s)
Running custom action.    (0.03s)
Running custom action.    (0.03s)
Compiling code.    (0.13s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.02s)
    (AndroidX SDK)
Compiling resources    (0.25s)
Linking resources    (0.57s)
Compiling debugger engine code.    (1.07s)
Compiling generated Java code.    (1.41s)
Finding libraries that need to be dexed.    (0.01s)
Dex code    (1.42s)
Dex merge    (3.39s)
Copying libraries resources    (1.13s)
ZipAlign file.    (0.05s)
Signing package file (private key).    (0.68s)
Installing file to device.    Error
adb: failed to install HuaweiServices_RAPID_DEBUG.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl285166836.tmp/base.apk (at Binary XML file line #149): com.huawei.hms.support.api.push.PushReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
 
Upvote 0
Top