Installation blocked when debugging app by Android Studio

4

When trying to debug or install an application that I'm developing, the following message appears on the device where the APK is being installed.

Locked installation.

This app contains code created to circumvent Android security protections.

This started to happen out of nowhere, I had to delete the project and check again for SVN, and redo what I had changed, it worked at first, but now after any change in code, this error reappears.

This project is already big, little more than a year of development.

I have not found any similar case on the internet, I hope someone can help me with this.

Permissions used by the app:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<permission
    android:name="br.com.empresa.projeto.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name="br.com.empresa.projeto.permission.C2D_MESSAGE" />

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "br.com.empresa.projeto"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 2
        versionName "2.6"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    useLibrary 'org.apache.http.legacy'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
    compile 'com.android.support:design:23.4.0'
    compile files('libs/androidasync-2.1.3.jar')
    compile files('libs/ion-2.1.3.jar')
    compile files('libs/gson-2.4.jar')
    compile files('libs/picasso-2.5.2.jar')
    compile files('libs/generalscan_sdk.jar')
    compile 'com.google.android.gms:play-services:7.5.+'
    compile 'com.android.support:multidex:1.0.1'
    compile files('libs/core-3.2.0.jar')
    testCompile 'junit:junit:4.12'
}

An interesting detail, this started shortly after integrating Android Studio with SVN, before using the TortoiseSVN tool.

    
asked by anonymous 12.07.2016 / 10:39

2 answers

0

I believe that in addition to enabling USB debugging, you should enable the: Unknown sources option by going to the Settings menu and going to Security on your device.

    
12.07.2016 / 16:09
0

Speak Heris,

Looking at your code, I believe what's blocking is this here:

<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

What's his role? Did you try to pull and compile?

And I noticed that you're putting the .jar libs, try to put the gradle link, for example:

instead of:

compile files('libs/picasso-2.5.2.jar')

try to place:

compile 'com.squareup.picasso:picasso:2.5.2'

Hugs.

    
12.07.2016 / 16:33