react-native-config-reader icon indicating copy to clipboard operation
react-native-config-reader copied to clipboard

package not working for different app variants like releaseStaging

Open pankajgupta1 opened this issue 5 years ago • 4 comments

I have these variants:

  1. debug
  2. release
  3. releaseStaging

import RNConfigReader from 'react-native-config-reader';

RNConfigReader is null for releaseStaging

pankajgupta1 avatar Oct 20 '20 15:10 pankajgupta1

I also had this problem when I started using debug, staging and release build variants. These build variants each had their own applicationIdSuffix, which was causing the problem.

As per https://github.com/csath/react-native-config-reader/issues/26, adding the following to the defaultConfig solved it: resValue "string", "rn_config_reader_custom_package", "my.package.app" (the applicationId without the suffix)

    defaultConfig {
        applicationId "my.package.app"
        resValue "string", "rn_config_reader_custom_package", "my.package.app" //Add this line here
        buildConfigField "String", "CONFIGKEY", '"Dummy"'
    }
   
    buildTypes {
        debug {
            applicationIdSuffix ".debug"
            ...
        }
        release {
            applicationIdSuffix ".prod"
            ...
        }

        staging {
            applicationIdSuffix ".acc"
            ...
        }
    }

SuzanneHuntink avatar Dec 27 '20 15:12 SuzanneHuntink

Some solution?

fernandopascoalbr avatar Mar 11 '21 22:03 fernandopascoalbr

any solution ?

ghadeeraqraa1992 avatar Apr 12 '21 07:04 ghadeeraqraa1992

Hello, everyone. I thought I'd introduce myself as a new maintainer for this project, pitching in to try and help the author, who has become very busy with personal matters (some more info available on the matter on #41).

That said, I'm afraid I don't (presently, anyway) have great insight to offer on this particular problem, as I'm particularly weak on the Android side of things at this time. That said, I both eager strengthen my Android skills and very happy to review PRs from the community 🙂

prometheas avatar Feb 02 '22 17:02 prometheas