Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] java – Android BuildConfig class values are null

Posted on November 14, 2022

Solution 1 :

You import wrong BuildConfig file

Remove your BuildConfig import & re-import your app module BuildConfig

Problem :

In my app I need to fetch the app version code and name so I was using below statement.

 obj.setCurrentVersion("APP " + 
 String.valueOf(BuildConfig.VERSION_NAME));

It was working fine and returns correct result.
But now it’s return empty string once i checked BuildConfig class all the values are empty.

public final class BuildConfig {
    public static final boolean DEBUG = false;
    public static final java.lang.String APPLICATION_ID = "androidx.multidex";
    public static final java.lang.String BUILD_TYPE = "release";
    public static final java.lang.String FLAVOR = "";
    public static final int VERSION_CODE = -1;
    public static final java.lang.String VERSION_NAME = "";

    public BuildConfig() { /* compiled code */ }
}
     

Build_gradle file

apply plugin: 'com.android.application'

android {
    signingConfigs {
        config {
         
        }
    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.app.application"
        minSdkVersion 21 //21
        targetSdkVersion 28
        versionCode 16 //15
        versionName "2.0.4"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

Why is that happening and how to fix it?

Comments

Comment posted by Kishore Jethava

post

Comment posted by rav

@KishoreJethava added

Comment posted by Kishore Jethava

You are searching in wrong

Comment posted by rav

@KishoreJethava Yeah right i didn’t notice that. How to solve it? shall I change the application id value in BuildConfig manually?

READ  [ANSWERED] android - I am not able to set layout for my other activity
Powered by Inline Related Posts

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress