1

I have added a dynamic feature to a project and it is giving me an AAPT error when trying to run the instrumentation tests.

The project has 3 product flavors:

  • development
  • preproduction
  • production

In the build.gradle of the dynamic module, I have put the flavors and compiles everything correctly. But trying to run the instrumentation tests gives me this error:

<dynamic-feature-route>/build/intermediates/tmp/manifest/androidTest/development/debug/manifestMerger2359481887313534357.xml:7:5-9:19: AAPT: error: resource string/app_name (aka <dynamic-feature-package-name>.test:string/app_name) not found.

I've tried several things, but I don't find out the solution.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Gabi Moreno
  • 871
  • 1
  • 8
  • 21

1 Answers1

1

The solution was actually very easy...

It has been as simple as overriding the app_name in each flavor of the build.gradle dynamic module.

productFlavors {
    development {
        resValue "string", "app_name", "Foo App Name·dev"
    }

    preproduction {
        resValue "string", "app_name", "Foo App Name·pre"
    }

    production {
        resValue "string", "app_name", "Foo App Name"
    }
}
Gabi Moreno
  • 871
  • 1
  • 8
  • 21