Giter VIP home page Giter VIP logo

testdynamicfeature's Introduction

Test Dynamic Feature

This project is intended just to show a possible bug when building an application with dynamic features.

Scenario

Having a project with:

  • An application module
  • A dynamic feature module
  • A library module

The dynamic feature has a dependency with the library module, and the library module has a dependency that defines a provider in its manifest (an image picker for instance).

If wy try to run the application through bundle generation:

./gradlew extractApksForDebug

We get the error:

Execution failed for task ':app:makeApkFromBundleForDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.BundleToApkTask$BundleToolRunnable
   > Multiple meta-data entries with the same name are found inside provider:com.github.dhaval2404.imagepicker.ImagePickerFileProvider: name: "meta-data"
     attribute {
       namespace_uri: "http://schemas.android.com/apk/res/android"
       name: "name"
       value: "android.support.FILE_PROVIDER_PATHS"
       resource_id: 16842755
     }
     attribute {
       namespace_uri: "http://schemas.android.com/apk/res/android"
       name: "resource"
       value: "@xml/image_picker_provider_paths"
       resource_id: 16842789
       compiled_item {
         ref {
           id: 2148335616
           name: "xml/image_picker_provider_paths"
           type_flags: 1
         }
       }
     }
     , name: "meta-data"
     attribute {
       namespace_uri: "http://schemas.android.com/apk/res/android"
       name: "name"
       value: "android.support.FILE_PROVIDER_PATHS"
       resource_id: 16842755
     }
     attribute {
       namespace_uri: "http://schemas.android.com/apk/res/android"
       name: "resource"
       value: "@xml/image_picker_provider_paths"
       resource_id: 16842789
       compiled_item {
         ref {
           id: 2131886080
           name: "xml/image_picker_provider_paths"
           type_flags: 1
         }
       }
     }

As a workaround, you can set dist:removable to true on the dynamic features Manifest to avoid fusing the dynamic feature APK into the base module:

<dist:delivery>
  <dist:install-time>
    <dist:removable dist:value="true" />
  </dist:install-time>
</dist:delivery>

Maybe this error is related to duplicate resources:

testdynamicfeature's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.