【问题标题】:Updating Android Studio to 0.3.5 .Project doesnt work ClassNotFoundException将 Android Studio 更新到 0.3.5 .Project 不起作用 ClassNotFoundException
【发布时间】:2013-11-14 21:26:46
【问题描述】:

我有两个项目。 DataModel 和我的应用程序。 我的应用程序成功启动,但随后因 classnotfoundexception 而失败。找不到 DataModel 项目。我以前也遇到过同样的问题,但我可以通过更新 gradle 文件来解决它,尽管随机 android studio 会搞砸它们

DataModel build.gradle

apply plugin: 'java'

MyApplication build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 18
    buildToolsVersion "18.1.1"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 18
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:18.0.0'
    compile 'com.android.support:gridlayout-v7:18.0.0'
    compile 'com.android.support:support-v4:18.0.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.squareup.okhttp:okhttp:1.2.1'
    compile 'com.squareup.retrofit:retrofit:1.2.2'
    compile project(':DataModel')
}

MyApplication settings.gradle

包括':MyApplication'、':DataModel'

【问题讨论】:

    标签: android android-studio


    【解决方案1】:

    您是否尝试过清理项目?构建--> 清理

    【讨论】:

      【解决方案2】:

      实际上有一个关于类似的已知问题,如果你更新到 0.3.6 可能就足够了。

      https://code.google.com/p/android/issues/detail?id=62011

      【讨论】:

        猜你喜欢
        • 2021-10-06
        • 2020-02-22
        • 2017-02-20
        • 1970-01-01
        • 2020-09-28
        • 2013-05-11
        • 1970-01-01
        • 1970-01-01
        • 2021-07-30
        相关资源
        最近更新 更多