1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question [Solved] [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] using Firebase

Discussion in 'Android Questions' started by AHilberink, May 6, 2019.

  1. AHilberink

    AHilberink Active Member Licensed 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é
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the full code from the manifest editor?
     
  3. AHilberink

    AHilberink Active Member Licensed User

    Hi Erel,

    Yes, sure:
    Code:
    '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)
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I don't see any issue. Try to create a new project and add Firebase resources. See if it works.
     
  5. AHilberink

    AHilberink Active Member Licensed User

    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é
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    See my private message.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Does it work if you comment FirebaseAnalytics.Firebase and keep the other Firebase resources?
     
  8. AHilberink

    AHilberink Active Member Licensed User

    No it does not. I got a lot of error in the History tab.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    I've just tested an app with Firebase on an Android 4.1. It works fine.

    It seems like a compatibility issue with your tablet. It is not related to the Android version.
     
  10. AHilberink

    AHilberink Active Member Licensed User

    Strange. It is a normal Samsung SM-T530 tablet.
    Can I change something to make it work?
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    If this is a development device then it is worth doing a factory reset.
     
  12. AHilberink

    AHilberink Active Member Licensed 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é
     
  13. AHilberink

    AHilberink Active Member Licensed User

    Whole compile/install log:
    Code:
    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]
     
  14. AHilberink

    AHilberink Active Member Licensed User

    I found this within my Log:
    Bad class name CIRIS.Chauffeur.permission.C2D_MESSAGE in package CIRIS.Chauffeur

    Could this be the cause?
     
  15. Erel

    Erel Administrator Staff Member Licensed 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.
     
  16. DonManfred

    DonManfred Expert Licensed User

    his bug report now makes more sense...
     
  17. AHilberink

    AHilberink Active Member Licensed User

    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.
     
  18. AHilberink

    AHilberink Active Member Licensed User

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice