Search code examples
androidsecurityapkgoogle-play-protect

Google drive indicates my self-made apk as a virus?


When I try to install a self-made APK from google Drive, I get the message: "apk is infected with a virus".

enter image description here

or something like this:

enter image description here

I uploaded the APK to https://www.virustotal.com and only the google check failed. But I get no further indication why.

I use the following dependencies in my build.gradle(module-level)

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.google.dagger.hilt.android'
    id 'androidx.navigation.safeargs'
}

apply plugin: 'kotlin-kapt'

android {
    ...
    compileSdk 33

    defaultConfig {
        ...
        minSdk 28
        targetSdk 33
    }
}

dependencies {
    def room_version = "2.5.0"

    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
    implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
    testImplementation 'junit:junit:4.13.2'
    testImplementation "androidx.arch.core:core-testing:2.2.0"
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    androidTestImplementation "androidx.arch.core:core-testing:2.2.0"

    implementation("androidx.room:room-runtime:$room_version")
    annotationProcessor("androidx.room:room-compiler:$room_version")
    kapt("androidx.room:room-compiler:$room_version")
    implementation("androidx.room:room-ktx:$room_version")
    implementation("androidx.room:room-paging:$room_version")

    androidTestImplementation("androidx.room:room-testing:$room_version")
    androidTestImplementation 'androidx.test:rules:1.5.0'

    implementation("com.google.dagger:hilt-android:2.44")
    kapt("com.google.dagger:hilt-android-compiler:2.44")

    testImplementation("com.google.dagger:hilt-android-testing:2.44")
    kaptTest("com.google.dagger:hilt-android-compiler:2.44")

    androidTestImplementation("com.google.dagger:hilt-android-testing:2.44")
    kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44")
}

and build.gradle(top-level)

buildscript {
    repositories {
        google()
    }
    dependencies {
        classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.6.0-alpha07")
    }
}

plugins {
    id 'com.android.application' version '7.4.2' apply false
    id 'com.android.library' version '7.4.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
    id 'com.google.dagger.hilt.android' version "2.45" apply false
}

On my Android device I use Android 13.

Does anyone have any idea how I can fix the problem or get more information about which file or library is causing this error?


Solution

  • It turns out that the debuggable true option in release buildTypes in build.gradle(module-level) is responsible for the warning message. I was not aware that this option would cause google Drive to block the apk and believe that the option had been enabled for some time. However, the APK can now be installed as usual.