android always on debug mode

I've tried to upload the apk to the store. I get this error:

You uploaded a debuggable APK or Android App Bundle. For security reasons you need to disable debugging before it can be published in Google Play

And the build has a signing key. I've tried using "master" and "release". Same error.

After building the project go to /Temp/gradle.out and check build.gradle file, does it have debuggable anywhere

nope, that file is pretty simple actually:

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
allprojects {
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'

}
}
repositories {
google()
jcenter()
flatDir {
dirs "${project(':unityLibrary').projectDir}/libs"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

I don't see any references to it be release or debug

There are more than one build.gradle, this is top one, there are still two - one in launcher, one in library


// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
apply plugin: 'com.android.application'
dependencies {
implementation project(':unityLibrary')
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 19
targetSdkVersion 28
applicationId 'com.echoboom.dogfightelite'
ndk {
abiFilters 
}
versionCode 538
versionName '1.1.12'
}
aaptOptions {
noCompress = ['.unity3d', '.ress', '.resource', '.obb']
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}
signingConfigs {
release {
storeFile file('D:/My Dropbox/My Dropbox/DogfightUnity5/mydogfightkey.keystore')
storePassword 'mypassword'
keyAlias 'dogfight'
keyPassword 'mypassword'
}
}
lintOptions {
abortOnError false
}
buildTypes {
debug {
minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt')
jniDebuggable true
}
release {
minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt')
signingConfig signingConfigs.release
}
}
packagingOptions {
doNotStrip '*/armeabi-v7a/*.so'
doNotStrip '*/arm64-v8a/*.so'
}
splits {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a'
universalApk false
}
}
bundle {
language {
enableSplit = false
}
density {
enableSplit = false
}
abi {
enableSplit = true
}
}
}
ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2]
import com.android.build.OutputFile
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
if (baseAbiVersionCode != null) {
output.versionCodeOverride = baseAbiVersionCode * 100000 + variant.versionCode
}
}
}

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
apply plugin: 'com.android.library'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation(name: 'androidx.appcompat.appcompat-1.0.0', ext:'aar')
implementation(name: 'androidx.arch.core.core-runtime-2.0.0', ext:'aar')
implementation(name: 'androidx.asynclayoutinflater.asynclayoutinflater-1.0.0', ext:'aar')
implementation(name: 'androidx.browser.browser-1.0.0', ext:'aar')
implementation(name: 'androidx.cardview.cardview-1.0.0', ext:'aar')
implementation(name: 'androidx.coordinatorlayout.coordinatorlayout-1.0.0', ext:'aar')
implementation(name: 'androidx.core.core-1.0.0', ext:'aar')
implementation(name: 'androidx.cursoradapter.cursoradapter-1.0.0', ext:'aar')
implementation(name: 'androidx.customview.customview-1.0.0', ext:'aar')
implementation(name: 'androidx.documentfile.documentfile-1.0.0', ext:'aar')
implementation(name: 'androidx.drawerlayout.drawerlayout-1.0.0', ext:'aar')
implementation(name: 'androidx.fragment.fragment-1.0.0', ext:'aar')
implementation(name: 'androidx.interpolator.interpolator-1.0.0', ext:'aar')
implementation(name: 'androidx.legacy.legacy-support-core-ui-1.0.0', ext:'aar')
implementation(name: 'androidx.legacy.legacy-support-core-utils-1.0.0', ext:'aar')
implementation(name: 'androidx.legacy.legacy-support-v4-1.0.0', ext:'aar')
implementation(name: 'androidx.lifecycle.lifecycle-livedata-2.0.0', ext:'aar')
implementation(name: 'androidx.lifecycle.lifecycle-livedata-core-2.0.0', ext:'aar')
implementation(name: 'androidx.lifecycle.lifecycle-runtime-2.0.0', ext:'aar')
implementation(name: 'androidx.lifecycle.lifecycle-viewmodel-2.0.0', ext:'aar')
implementation(name: 'androidx.loader.loader-1.0.0', ext:'aar')
implementation(name: 'androidx.localbroadcastmanager.localbroadcastmanager-1.0.0', ext:'aar')
implementation(name: 'androidx.media.media-1.0.0', ext:'aar')
implementation(name: 'androidx.print.print-1.0.0', ext:'aar')
implementation(name: 'androidx.slidingpanelayout.slidingpanelayout-1.0.0', ext:'aar')
implementation(name: 'androidx.swiperefreshlayout.swiperefreshlayout-1.0.0', ext:'aar')
implementation(name: 'androidx.vectordrawable.vectordrawable-1.0.0', ext:'aar')
implementation(name: 'androidx.vectordrawable.vectordrawable-animated-1.0.0', ext:'aar')
implementation(name: 'androidx.versionedparcelable.versionedparcelable-1.0.0', ext:'aar')
implementation(name: 'androidx.viewpager.viewpager-1.0.0', ext:'aar')
implementation(name: 'com.facebook.android.facebook-applinks-5.5.1', ext:'aar')
implementation(name: 'com.facebook.android.facebook-common-5.5.1', ext:'aar')
implementation(name: 'com.facebook.android.facebook-core-5.5.1', ext:'aar')
implementation(name: 'com.facebook.android.facebook-login-5.5.1', ext:'aar')
implementation(name: 'com.facebook.android.facebook-share-5.5.1', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-auth-16.0.1', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-auth-api-phone-16.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-auth-base-16.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-base-17.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-basement-17.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-drive-16.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-games-17.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-nearby-16.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-stats-17.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-tasks-17.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-common-18.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-iid-19.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-iid-interop-17.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-measurement-connector-18.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-messaging-19.0.0', ext:'aar')
implementation(name: 'com.google.games.gpgs-plugin-support-0.9.64', ext:'aar')
implementation(name: 'com.pushwoosh.pushwoosh-5.17.0', ext:'aar')
implementation(name: 'com.pushwoosh.pushwoosh-amazon-5.17.0', ext:'aar')
implementation(name: 'com.pushwoosh.pushwoosh-badge-5.17.0', ext:'aar')
implementation(name: 'common', ext:'aar')
implementation(name: 'EtceteraPlugin', ext:'aar')
implementation(name: 'facebook-android-wrapper-7.17.2', ext:'aar')
implementation(name: 'GoogleAIDL', ext:'aar')
implementation(name: 'GooglePlay', ext:'aar')
implementation(name: 'pushwoosh-unityplugin-5.17.0', ext:'aar')
implementation(name: 'UnityAds', ext:'aar')
implementation project('AndroidLibrary')
implementation project('GooglePlayGamesManifest.plugin')
implementation project('unity-android-resources')
implementation project('UnityOBBDownloader')
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 19
targetSdkVersion 28
ndk {
abiFilters 
}
versionCode 538
versionName '1.1.12'
consumerProguardFiles 'proguard-unity.txt'
}
lintOptions {
abortOnError false
}
aaptOptions {
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}
packagingOptions {
doNotStrip '*/armeabi-v7a/*.so'
doNotStrip '*/arm64-v8a/*.so'
}
}

I've also tried building manually using gradle and uploading the apk on the "release" folder. Same thing. It's as if something inside the unity libraries makes it fail.

Can you drag & drop apk on Android Studio, and check AndroidManifest.xml and see if it has

  android:debuggable="true"

yes it does, and it seems unity template does too by default. Changing it to false and seeing whether that fixes it

Got the same problem. Debuggable = true. Tried changing it to false in manifest files in the project, did to work, it just gets reverted. Opened in Android Studio, it says false, and I don’t think I can change the value there. Help Tomas?

I had the same issue. It was related to the Facebook-Google services plugin, which sets it to true. For me, changing all the Debuggable=true tags in the Manifest.xml's to False, did the trick.
Any chance you are missing an Manifest file or a tag somewhere?

I could solve the issue by changing just the “YourProject\Assets\Plugins\Android\AndroidManifest.xml” file.
Unity generates many AndroidManifest.xml files from this one file, generating them in the TEMP folder. So just changing this one file did the trick.

Line 4: <application android:icon=“@drawable/app_icon” android:label=" @anon_76954444 /app_name" android:debuggable=“false”>

1 Like