Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake error on Android Build #46

Open
barzin144 opened this issue Sep 7, 2023 · 11 comments
Open

cmake error on Android Build #46

barzin144 opened this issue Sep 7, 2023 · 11 comments

Comments

@barzin144
Copy link

barzin144 commented Sep 7, 2023

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
Copy link

github-actions bot commented Sep 7, 2023

👋 @barzin144
Thanks for opening your issue here! If you find this package useful hit the star🌟!

@numandev1
Copy link
Owner

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

@chanphiromsok
Copy link

chanphiromsok commented Sep 7, 2023

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
Copy link
Owner

@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
Copy link

chanphiromsok commented Sep 7, 2023

@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
Copy link
Author

@barzin144 what version of react-native-keys, you are using? I did not test this package on [email protected] , 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
Copy link
Owner

@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
Copy link
Owner

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

@chanphiromsok
Copy link

chanphiromsok commented Sep 7, 2023

@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
Copy link
Owner

numandev1 commented Sep 7, 2023

@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
Copy link

@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

  • if other packages if modified this you need to use regex to check if it exist and don't override other plugins just append your content to variant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants