0

J'ai implémenté le fichier d'extension en suivant ce tutoriel https://iphonedevlog.wordpress.com/2014/12/12/adding-an-android-apk-expansion-file-to-a-cordova-project. J'ai utilisé le fichier d'extension cordova plugin https://github.com/agamemnus/cordova-plugin-xapkreader/tree/cordova-6.5.0.Crash de l'application Android pour le plugin de fichier d'extension de cordoue

J'ai publié l'application en tant qu'alpha pour jouer en magasin pour les tests. L'application s'est écrasée lors du lancement et donner une notification de téléchargement comme l'image ci-dessous.

enter image description here

Répondre

0

Nous devons modifier certaines config comme suit:

  1. dans ./config.xml

    <variable name="XAPK_EXPANSION_AUTHORITY" value="PACKAGE_NAME" /> 
    <variable name="XAPK_PUBLIC_KEY" value="PUBLIC_API_KEY" /> 
    <variable name="XAPK_PATCH_VERSION" value="-1" /> 
    
  2. dans ./plugins/android.json

    "com.flyingsoftgames.xapkreader": { 
        "XAPK_EXPANSION_AUTHORITY": "PACKAGE_NAME", 
        "XAPK_PUBLIC_KEY": "PUBLIC_API_KEY", 
        "XAPK_PATCH_VERSION": "-1" 
    } 
    
  3. dans ./platforms/android.json

    "res/values/xapkreader.xml": { 
         "parents": { 
          "/*": [ 
           { 
            "xml": "<string name=\"xapk_expansion_authority\">PACKAGE_NAME</string>", 
            "count": 1 
           }, 
           { 
            "xml": "<string name=\"xapk_google_play_public_key\">PUBLIC_API_KEY</string>", 
            "count": 1 
           }, 
           { 
            "xml": "<integer name=\"xapk_patch_version\">-1</integer>", 
            "count": 1 
           } 
          ] 
         } 
        } 
    
  4. dans ./platforms/res/values/xapkreader.xml

    <resources xmlns:android="http://schemas.android.com/apk/res/android"> 
        <string name="xapk_expansion_authority">PACKAGE_NAME </string> 
        <string name="xapk_google_play_public_key">PUBLIC_API_KEY </string> 
        <integer name="xapk_patch_version">-1</integer> 
    </resources> 
    

Note: ne pas oublier de remplacer dans PACKAGE_NAME et PUBLIC_API_KEY comme votre config d'application.