简体   繁体   中英

Android Studio APK path not specified for module

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:

在此处输入图片说明

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM