Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio not generate signed apk

recently I updated my working android studio IDE into Android Studio 1.5.1. but now I'm facing some trouble as after updating it did not generating signed apk file. but when I plug a device and run the app, it runs properly. when I use

Build -> Generate Signed Apk

in the Event Log it shows

10:38:51 AM Executing tasks: [:app:assembleRelease]

and the slider shows some time and it disappear. It does not show build generation completion dialog too. then I change build variant and try to run the app using a connected device. and in the Event Log it sows

10:43:32 AM Executing tasks: [:app:assembleDebug]

after few seconds a pop up coms saying Apk(s) generated successfully, but still the signed apk is not there at the relavent folder. and the app runs in the device properly. and my full Event Log is as follow.

10:38:51 AM Executing tasks: [:app:assembleRelease]
10:43:32 AM Executing tasks: [:app:assembleDebug]
10:43:46 AM Gradle build finished in 13s 964ms
10:43:46 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:46 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:46 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:46 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:47 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:47 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:47 AM Generate Signed APK
            APK(s) generated successfully.
            Reveal in Finder
10:43:52 AM Session 'app': Launched on samsung-sm_t211-4100cede9628b000

also my build.gradel file is as following.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '23.0.0 rc3'
    defaultConfig {
        applicationId "com.lf"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 63
        versionName '2.0.9'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile 'com.android.support:support-v4:22.2.1'
    compile project(':holoColorPickermaster')
    compile project(':qRCodeReaderViewlib')
    compile project(':volley')
    compile project(':library')
}

so how can I fix this. I fully update Android studio after this was happen and it still the same.

like image 625
Samantha Withanage Avatar asked Dec 09 '15 05:12

Samantha Withanage


People also ask

Where is generate signed APK?

In the menu bar, click Build > Generate Signed Bundle/APK. In the Generate Signed Bundle or APK dialog, select Android App Bundle or APK and click Next. Below the field for Key store path, click Create new.

Does an APK need to be signed?

In Android, an apk should be signed with its developer's certificate before installed, while those without valid signatures cannot be installed.

Which file is used to generate signed APK?

gradle file as recommended by Google is explained here. Basically, you add a signingConfig, in where you specify the location an password of the keystore. Then, in the release build type, refer to that signing configuration.


2 Answers

I was facing same issue but i resolved the issue by adding below code in build.gradle

lintOptions {
        checkReleaseBuilds false
    }

This issue would occur, Sometimes our application not follow all the rules and regulation according to Lint Tool

Note: Add this in application module inside android

like image 108
sharma_kunal Avatar answered Sep 18 '22 14:09

sharma_kunal


For Android Studio 3, instead of putting the APK directly into the folder, it creates a "release" folder or a folder that matches the flavor of your build.

So when you click locate, it puts you at the app level. You need to go into the release folder to get your APK file.

prompt to locate your APK file

Typically you'd look in the release folder:

folder structure in AS 3

But if you built some other flavor aside from the release flavor, you would look for a folder with that name.

like image 38
Dale Avatar answered Sep 16 '22 14:09

Dale