Android Question [Solved] [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] using Firebase

AHilberink

Active Member
Licensed User
Longtime User
Hi,

I got the error "[INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]" during installing APK on an Android v5 device. Installing it on an Android v8 device, no problem.

It seems to be connected to the manifest line:
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

I tried change all $ to .$ within the manifest, but no result.

Some other suggestions?

Best regards,
André
 

AHilberink

Active Member
Licensed User
Longtime User
Hi Erel,

Yes, sure:
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="19" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, ".$LABEL$")
'End of default text.

SetActivityAttribute(Main, android:windowSoftInputMode, adjustResize|stateHidden)
SetActivityAttribute(Alarm, android:theme, "@android:style/Theme.Translucent")
SetActivityAttribute(SelectContainers, android:theme, "@android:style/Theme.Translucent")
SetActivityAttribute(Synchroniseer, android:theme, "@android:style/Theme.Translucent")

SetActivityAttribute (Hoofdscherm, android:showWhenLocked, "true")
SetActivityAttribute (Hoofdscherm, android:turnScreenOn, "true")

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)

AddPermission(android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(android.permission.USE_BIOMETRIC)
AddPermission(android.permission.USE_FINGERPRINT)
AddPermission(android.permission.ACCESS_NOTIFICATION_POLICY)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.RECEIVE_ULTRASONIC_API)
AddPermission(android.permission.BIND_JOB_SERVICE)

AddManifestText(
<uses-permission
  android:name="android.permission.WRITE_EXTERNAL_STORAGE"
  android:maxSdkVersion="19" />
)
AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities=".$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
AddApplicationText(<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
)
CreateResource(xml, provider_paths,
   <external-files-path name="shared" path="shared" />
)

'IconBadge (Number)
'Samsung
AddPermission(com.sec.android.provider.badge.permission.READ)
AddPermission(com.sec.android.provider.badge.permission.WRITE)
'HTC
AddPermission(com.htc.launcher.permission.READ_SETTINGS)
AddPermission(com.htc.launcher.permission.UPDATE_SHORTCUT)
'Sony
AddPermission(com.sonyericsson.home.permission.BROADCAST_BADGE)
AddPermission(com.sonymobile.home.permission.PROVIDER_INSERT_BADGE)
'Apex
AddPermission(com.anddoes.launcher.permission.UPDATE_COUNT)
'Solid
AddPermission(com.majeur.launcher.permission.UPDATE_BADGE)
'Huawei
AddPermission(com.huawei.launcher3.permission.READ_SETTINGS)
AddPermission(com.huawei.launcher3.permission.WRITE_SETTINGS)
AddPermission(com.huawei.launcher2.permission.READ_SETTINGS)
AddPermission(com.huawei.launcher2.permission.READ_SETTINGS)
AddPermission(com.huawei.android.launcher.permission.CHANGE_BADGE)
AddPermission(com.huawei.android.launcher.permission.WRITE_SETTINGS)
AddPermission(com.huawei.android.launcher.permission.READ_SETTINGS)
'Zuk
AddPermission(android.permission.READ_APP_BADGE)
'Oppo
AddPermission(com.oppo.launcher.permission.READ_SETTINGS)
AddPermission(com.oppo.launcher.permission.WRITE_SETTINGS)
'EvMe
AddPermission(me.everything.badger.permission.BADGE_COUNT_READ)
AddPermission(me.everything.badger.permission.BADGE_COUNT_WRITE)
 
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
I don't see any issue. Try to create a new project and add Firebase resources. See if it works.

Hi Erel,

I started a new project. Put only all neccesary part of firebase in it. Still the same error.
Putting a ' before "CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)" takes the error away, but no Firebase.
I update all of my tablet (v5.0.2). Are there parts I can check for minimum versionnumbers? On my Phone (v8.0.0) all works fine.

Best regards,
André
 
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
Hi,

Just test another tablet Samsung SM-T560 with Android 4.4.4.
Same error.

What can I do to make this work? My users all have Samsung tablets.

Best regards,
André
 
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
Whole compile/install log:
B4X:
B4A Versie: 8.80
Controleren code.    (0.14s)
Building folders structure.    (0.43s)
Compileren code.    (0.20s)
Compileren weergaven code.    (0.03s)
Bibliotheken organiseren.    (0.00s)
Generating R file.    (0.61s)
Compileren gegenereerde Java code.    (3.67s)
Convert byte code - dex.    (20.21s)
Packaging files.    (1.29s)
Copying libraries resources    (0.71s)
    Found 26 resource files.
Signing package file (private key).    (1.51s)
ZipAlign file.    (0.09s)
Installeren van het bestand op het apparaat.    Error
Performing Push Install
CIRIS_Chauffeur.apk: 1 file pushed. 4.5 MB/s (5448246 bytes in 1.147s)
    pkg: /data/local/tmp/CIRIS_Chauffeur.apk
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
 
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
I found this within my Log:
Bad class name CIRIS.Chauffeur.permission.C2D_MESSAGE in package CIRIS.Chauffeur

Could this be the cause?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
This is of course a mistake. Why have you added this dot? Note that you cannot expect us to see such changes you made. Help us help you.

Also make sure that the package name is all lower case.

his bug report now makes more sense...

This is a response to my bug report, I think.
After getting the error of this thread, I added a dot to the "$ within the manifest. This dot is not the reason of the error.

Because of this thread I thought this dot could be a solution. Sorry for my bugreport.
 
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
Also make sure that the package name is all lower case.

This solved my problem. In the Compiler configurations I had used Uppercase. May be a stupid, but I didn't know this cannot. My android v8 and v9 versions all worked and so my Android <v8 worked fine, until using Firebase.

Thanks Erel.
 
Upvote 0
Top