numandev1 / react-native-keys

πŸ” Protected .ENVs variables in React Native πŸš€βœ¨
MIT License
303 stars 25 forks source link

cmake error on Android Build #46

Closed barzin144 closed 2 weeks ago

barzin144 commented 1 year ago

Hi, I hope your doing well, I added react-native-keys to my project everything works find in ios, but for android I can't build the project and I've got this error

Execution failed for task ':react-native-keys:generateJsonModelDebug' executing external native build for cmake ..../node_modules/react-native/keys/android/CMakeLists.txt

React-native version 0.63 classpath("com.android.tools.build:gradle:4.1.3") gradle-wrapper: dradle-7.3.3-all.zip

github-actions[bot] commented 1 year ago

πŸ‘‹ @barzin144 Thanks for opening your issue here! If you find this package useful hit the star🌟!

numandev1 commented 1 year ago

@barzin144 what version of react-native-keys, you are using? I did not test this package on react-native@0.63.0 , can you provide me reproducable GitHub example so I can fix it quickly

chanphiromsok commented 1 year ago

expo prebuild also doesn't work can not find keys.*.json when I log Keys import from 'react-native-keys' it show other data like APPLICATION_ID BUILD_TYPE DEBUG instead

numandev1 commented 1 year ago

@chanphiromsok Expo support in this package is in progress, My question from you is, how do you manage different Xcode schemes and Android different variants?πŸ‘€

chanphiromsok commented 1 year ago

@chanphiromsok Expo support in this package is in progress, My question from you is, how do you manage different Xcode schemes and Android different variants?πŸ‘€

I haven't try on IOS yet I test only android πŸ˜… build IOS is time consuming for me machine

barzin144 commented 1 year ago

@barzin144 what version of react-native-keys, you are using? I did not test this package on react-native@0.63.0 , can you provide me reproducable GitHub example so I can fix it quickly

I'm using verions 0.6.0 I've update classpath com.android.tools.build:gradle to 4.2.2, But it made me to update other packages after updating every thing I've succeed to build but when I've tried to run on simulator I've got the error like can't call method async...

numandev1 commented 1 year ago

@chanphiromsok how do you manage android variants?

 buildTypes {
        debug {
            signingConfig signingConfigs.debug
            applicationIdSuffix ".dev"
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://reactnative.dev/docs/signed-apk-android.
            signingConfig signingConfigs.release
            applicationIdSuffix ".lava"
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
        releasestaging {
            initWith release
            applicationIdSuffix ".dev"
            matchingFallbacks = ['release']
        }
    }
numandev1 commented 1 year ago

@barzin144 i did not experience this error, can we both look it on zoom?

chanphiromsok commented 1 year ago

@chanphiromsok how do you manage android variants?


 buildTypes {

        debug {

            signingConfig signingConfigs.debug

            applicationIdSuffix ".dev"

        }

        release {

            // Caution! In production, you need to generate your own keystore file.

            // see https://reactnative.dev/docs/signed-apk-android.

            signingConfig signingConfigs.release

            applicationIdSuffix ".lava"

            minifyEnabled enableProguardInReleaseBuilds

            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"

        }

        releasestaging {

            initWith release

            applicationIdSuffix ".dev"

            matchingFallbacks = ['release']

        }

    }

I use expo config to inject in app build.gradle base on ENV. It would be good if you write expo plugin for this package πŸ€’

numandev1 commented 1 year ago

@chanphiromsok I was writing an expo plugin, but I am afraid that some packages also had been making Android build variants and my package also has been making build variants then we can get into conflict. what do you suggest?

Screenshot 2023-09-07 at 3 24 47 PM

chanphiromsok commented 1 year ago

@chanphiromsok I was writing an expo plugin, but I am afraid that some packages also had been making Android build variants and my package also has been making build variants then we can get into conflict. what do you suggest?

Screenshot 2023-09-07 at 3 24 47 PM

I have an idea but I can't write Regex -first read file app/build.gradle

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 2 weeks ago

This issue was closed because it has been stalled for 7 days with no activity.