我最近升级到android studio 1.2.1.1,当我运行我的项目时突然发现错误“本地路径不存在”?
这是因为调试.apk文件不在IDE正在查找的位置。
本地路径:C:\ Users \ eoin_a \ AndroidStudioProjects \ XmppTest \ app \ build \ outputs \ apk \ app-debug.apk
我已经搜索过自己,而apk不存在。事实上我似乎无法在我的项目中找到.apk文件?我已经尝试了一些我在之前提出的问题上看过的解决方案,但我在这里没有任何喜悦。我已经尝试与gradle同步并清理项目而没有运气。
我试过用cmd“gradlew clean packageDebug”无济于事。
我会尝试将其添加到项目.iml文件
<option name="APK_PATH" value="/build/apk/apk file name" />
内部标签。
但是我没有.apk文件或者我找不到它。 如果有人能帮助我,那将是非常棒的!
还将我的依赖项放在gradle中我有gradle插件版本1.2.3
classpath 'com.android.tools.build:gradle:1.2.3'
编辑:
以为id提出了我的gradle.build文件,因为它们可能有用。我仍然不确定最新情况
申请插件:'com.android.application' 申请插件:'com.neenbedankt.android-apt'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.eoin_a.xmpptest"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile ("org.igniterealtime.smack:smack-android:4.1.0-rc1")
{
exclude(group: 'xpp3', module: 'xpp3')
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
compile ("org.igniterealtime.smack:smack-tcp:4.1.0-rc1")
{
exclude(group: 'xpp3', module: 'xpp3')
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
// optional features
compile ("org.igniterealtime.smack:smack-android-extensions:4.1.0-rc1")
{
exclude(group: 'xpp3', module: 'xpp3')
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
compile 'javax.annotation:jsr250-api:1.0'
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
compile 'org.glassfish:javax.annotation:10.0-b28'
testCompile 'junit:junit:4.12'
testCompile "org.assertj:assertj-core:1.7.0"
testCompile('org.robolectric:robolectric:3.0-rc2') {
exclude group: 'commons-logging', module: 'commons-logging'
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
}
和
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
}
}
答案 0 :(得分:0)
您能否以这种方式看到您的设置:
1.在build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
2.在gradle-wrapper.properties中,确保使用gradle 2.2.1
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
3.按下avd按钮左侧的按钮
,使用gradle文件同步项目
4.尝试再次建造项目。如果仍有问题可能请尝试文件&gt;使高速缓存无效/重新启动
这样做对我有用