C# if/then directives for debug vs release

DEBUG/_DEBUG should be defined in VS already. Remove the #define DEBUG in your code. Set preprocessors in the build configuration for that specific build. The reason it prints “Mode=Debug” is because of your #define and then skips the elif. The right way to check is: #if DEBUG Console.WriteLine(“Mode=Debug”); #else Console.WriteLine(“Mode=Release”); #endif Don’t check for RELEASE.

How to create a release signed apk file using Gradle?

Easier way than previous answers: Put this into ~/.gradle/gradle.properties RELEASE_STORE_FILE={path to your keystore} RELEASE_STORE_PASSWORD=***** RELEASE_KEY_ALIAS=***** RELEASE_KEY_PASSWORD=***** Modify your app/build.gradle, and add this inside the android { code block: … signingConfigs { release { storeFile file(RELEASE_STORE_FILE) storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD // Optional, specify signing versions used v1SigningEnabled true v2SigningEnabled true } } buildTypes { … Read more