【问题标题】:android studio upgrade to 1.2.1.1 results in "local path doesnt exist" errorandroid studio 升级到 1.2.1.1 导致“本地路径不存在”错误
【发布时间】:2015-06-05 11:52:48
【问题描述】:

我最近升级到 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()
}
  }

【问题讨论】:

  • 帮助! :)。我想我可能会删除该项目并重新开始。这是我能想到的最后一件事!?
  • 还没有弄清楚这一点。认为这是一个潜在的 IDE 怪癖。

标签: android android-studio android-gradle-plugin


【解决方案1】:

你能不能看看你是否有这样的设置:

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.尝试再次构建项目。如果仍有问题,请尝试 File > Invalidate Caches/Restart

这样做对我有用

我关注这个https://stackoverflow.com/a/19496969/2091181

【讨论】:

  • 我使用 mavenCentral()
  • 它似乎在构建,然后我得到更多与 Dagger 相关的错误。该死的
  • 在创建组件时使用“Dagger”注释。我猜这就是为什么它不会制作.apk。
  • 您是否将存储库 {mavenCentral()} 添加到您的 build.gradle 文件中?
  • 是的,将它从​​ jcenter() 更改为 mavenCentral()。还在我的应用程序 build.gradle 中添加了 compile 'javax.annotation:jsr250-api:1.0' 和 compile 'org.glassfish:javax.annotation:10.0-b28' 。问题似乎出在“Daggermycomponent”和导入 javax.annotation.Generated
猜你喜欢
  • 1970-01-01
  • 2013-05-28
  • 2013-06-12
  • 2015-02-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-07-12
  • 2015-05-11
相关资源
最近更新 更多