Android Studio APK path not specified for module

11,363

Solution 1

So after searching I found out the solution for this. First the problem that the "APK path is not specified for module "ProjectName" really means that the path was not configured correctly upon importing on your project. What you can do is do the steps I've done above but instead of that path locate your apk instead.

Now after doing it when you clean the app and tried to run it you will now encounter an error saying that the "Local path doesn't exists". when that happens go to your .iml file then just configure the path by adding this lines under the facet->configuration:

<option name="APK_PATH" value="/build/apk/YourProject.apk" />

Rebuild project then run. It works like magic indeed.

Solution 2

Try doing a ./gradlew clean, then go to Tools -> Android -> Sync Project with Gradle Files

If that doesn't work, then delete all your *.iml files and re-import the project. This process should only take a couple minutes if you're importing from a Gradle project

Share:
11,363
KaHeL
Author by

KaHeL

Updated on November 25, 2022

Comments

  • KaHeL
    KaHeL over 1 year

    I've updated my Android Studio into version 0.3.2. but I'm having a problem about my project and it gives me this error:

    enter image description here

    I only have a bit of idea on whats happening on this so I tried to press F4 (Windows) then 'Module' and then the TabFragmentExercise then tried to change the 'Paths' and selected the 'Use module compile path' just like on how the default project does and changed into this:

    C:\Users\PCNAME\AndroidStudioProjects\TabFragmentExerciseProject\TabFragmentExercise \build\classes\debug
    

    Then rebuild the project but still no chance. It will just give me this result:

    Local path doesn't exist.
    

    Here's my config for gradle anyways:

    gradle-wrapper.properties

    #Wed Apr 10 15:27:10 PDT 2013
    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
    

    build.gradle

    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.6.+'
        }
    }
    apply plugin: 'android'
    
    repositories {
        mavenCentral()
    }
    
    
    android {
        compileSdkVersion 17
        buildToolsVersion "17.0.0"
    
        defaultConfig {
            minSdkVersion 14
            targetSdkVersion 16
        }
    }
    
    
    dependencies {
        compile files('libs/android-support-v4.jar', 'libs/commons-io-2.4.jar', 'libs/apache-mime4j-0.6.1.jar', 'libs/httpclient-4.1.jar', 'libs/httpcore-4.1.jar', 'libs/httpmime-4.1.jar')
    }
    

    Hope someone can help me on this.

  • KaHeL
    KaHeL over 10 years
    I won't suggest this. :) BTW, I've already solved this problem posting my answer in a bit.
  • Priebe
    Priebe about 10 years
    A video running through the fix of adding apk_path to the iml file: youtube.com/watch?v=i4WcMIyc8OQ