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

Add buildConfig creation in android/build.gradle file #85

Open
minoesteban opened this issue Jan 29, 2025 · 1 comment
Open

Add buildConfig creation in android/build.gradle file #85

minoesteban opened this issue Jan 29, 2025 · 1 comment

Comments

@minoesteban
Copy link

minoesteban commented Jan 29, 2025

Hi, I am getting this error while trying to build a Flutter app for android, using quickblox_sdk: 0.16.4

/Users/esteban/.pub-cache/hosted/pub.dev/quickblox_sdk-0.16.4/android/src/main/java/com/quickblox/quickblox_sdk/notification/NotificationModule.java:16: error: cannot find symbol
import com.quickblox.quickblox_sdk.BuildConfig;
                                  ^
  symbol:   class BuildConfig
  location: package com.quickblox.quickblox_sdk
/Users/esteban/.pub-cache/hosted/pub.dev/quickblox_sdk-0.16.4/android/src/main/java/com/quickblox/quickblox_sdk/push/PushModule.java:14: error: cannot find symbol
import com.quickblox.quickblox_sdk.BuildConfig;
                                  ^
  symbol:   class BuildConfig
  location: package com.quickblox.quickblox_sdk
/Users/esteban/.pub-cache/hosted/pub.dev/quickblox_sdk-0.16.4/android/src/main/java/com/quickblox/quickblox_sdk/webrtc/call_manager/CallManager.java:6: error: cannot find symbol
import com.quickblox.quickblox_sdk.BuildConfig;
                                  ^
  symbol:   class BuildConfig
  location: package com.quickblox.quickblox_sdk
/Users/esteban/.pub-cache/hosted/pub.dev/quickblox_sdk-0.16.4/android/src/main/java/com/quickblox/quickblox_sdk/notification/NotificationModule.java:114: error: cannot find symbol
        if (BuildConfig.DEBUG) {
            ^
  symbol:   variable BuildConfig
  location: class NotificationModule
/Users/esteban/.pub-cache/hosted/pub.dev/quickblox_sdk-0.16.4/android/src/main/java/com/quickblox/quickblox_sdk/notification/NotificationModule.java:229: error: cannot find symbol
        if (BuildConfig.DEBUG) {
            ^
  symbol:   variable BuildConfig
  location: class NotificationModule
/Users/esteban/.pub-cache/hosted/pub.dev/quickblox_sdk-0.16.4/android/src/main/java/com/quickblox/quickblox_sdk/push/PushModule.java:84: error: cannot find symbol
        if (BuildConfig.DEBUG) {
            ^
  symbol:   variable BuildConfig
  location: class PushModule
/Users/esteban/.pub-cache/hosted/pub.dev/quickblox_sdk-0.16.4/android/src/main/java/com/quickblox/quickblox_sdk/webrtc/call_manager/CallManager.java:63: error: cannot find symbol
        if (BuildConfig.DEBUG) {
            ^
  symbol:   variable BuildConfig
  location: class CallManager
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors
3 warnings

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quickblox_sdk:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

Troubleshooting got me to a missing block in your android/build.gradle file. It's missing the following setting

android {
    ...

    buildFeatures {
        buildConfig true
    }
}

Adding this config fixes the problem.

I have tried but couldn't navigate your repositories to create a PR myself. So I leave the task here

Thank you for your time

@minoesteban minoesteban changed the title Need to add buildConfig creation in android/build.gradle file Add buildConfig creation in android/build.gradle file Jan 29, 2025
@kirillTolmachev
Copy link
Member

@minoesteban
Thank you very much for the information. We will add this parameter shortly.
Could please write what kind of gradle version are you using?

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

2 participants