Android Studio 0.8.1中的一切都很突破

时间:2014-07-08 16:32:30

标签: android android-studio

我刚刚将Android Studio从0.6.1更新为0.8.1

我的所有代码都没有更改,但新的更新会破坏所有内容。似乎整个Android SDK都没有正确加载。给定的类最终看起来像这样:

enter image description here

项目问题仍然使用旧的ANT编译系统,但我有另一个使用Gradle的项目,同样的问题正在发生。当我回到我原来安装的0.6.1时,它工作正常。

我检查了项目结构,以确保Project SDK指向正确的位置,它是。

使用gradle同步项目时,gradle控制台不会返回错误:

Executing tasks: [:app:generateDebugSources, :wearable:generateDebugSources, :facebook:generateDebugSources]

Configuration on demand is an incubating feature.
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:facebook:compileLint
:facebook:copyReleaseLint UP-TO-DATE
:facebook:preBuild
:facebook:preReleaseBuild
:facebook:checkReleaseManifest
:facebook:preDebugBuild
:facebook:preDebugTestBuild
:facebook:prepareComAndroidSupportSupportV42000Library UP-TO-DATE
:facebook:prepareReleaseDependencies
:facebook:compileReleaseAidl UP-TO-DATE
:facebook:compileReleaseRenderscript UP-TO-DATE
:facebook:generateReleaseBuildConfig UP-TO-DATE
:facebook:generateReleaseAssets UP-TO-DATE
:facebook:mergeReleaseAssets UP-TO-DATE
:facebook:generateReleaseResValues UP-TO-DATE
:facebook:generateReleaseResources UP-TO-DATE
:facebook:mergeReleaseResources UP-TO-DATE
:facebook:processReleaseManifest UP-TO-DATE
:facebook:processReleaseResources UP-TO-DATE
:facebook:generateReleaseSources UP-TO-DATE
:facebook:compileReleaseJava UP-TO-DATE
:facebook:extractReleaseAnnotations UP-TO-DATE
:facebook:mergeReleaseProguardFiles UP-TO-DATE
:facebook:processReleaseJavaRes UP-TO-DATE
:facebook:packageReleaseJar UP-TO-DATE
:facebook:compileReleaseNdk UP-TO-DATE
:facebook:packageReleaseJniLibs UP-TO-DATE
:facebook:packageReleaseLocalJar UP-TO-DATE
:facebook:packageReleaseRenderscript UP-TO-DATE
:facebook:packageReleaseResources UP-TO-DATE
:facebook:bundleRelease UP-TO-DATE
:app:prepareBandsintownGimportFacebookUnspecifiedLibrary UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72000Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42000Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices5077Library UP-TO-DATE
:app:prepareComViewpagerindicatorLibrary241Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:wearable:preBuild
:wearable:preDebugBuild
:wearable:checkDebugManifest
:wearable:preReleaseBuild
:wearable:prepareComGoogleAndroidGmsPlayServices5077Library UP-TO-DATE
:wearable:prepareDebugDependencies
:wearable:compileDebugAidl UP-TO-DATE
:wearable:compileDebugRenderscript UP-TO-DATE
:wearable:generateDebugBuildConfig UP-TO-DATE
:wearable:generateDebugAssets UP-TO-DATE
:wearable:mergeDebugAssets UP-TO-DATE
:wearable:generateDebugResValues UP-TO-DATE
:wearable:generateDebugResources UP-TO-DATE
:wearable:mergeDebugResources UP-TO-DATE
:wearable:processDebugManifest UP-TO-DATE
:wearable:processDebugResources UP-TO-DATE
:wearable:generateDebugSources UP-TO-DATE
:facebook:checkDebugManifest
:facebook:prepareDebugDependencies
:facebook:compileDebugAidl UP-TO-DATE
:facebook:compileDebugRenderscript UP-TO-DATE
:facebook:generateDebugBuildConfig UP-TO-DATE
:facebook:generateDebugAssets UP-TO-DATE
:facebook:mergeDebugAssets UP-TO-DATE
:facebook:generateDebugResValues UP-TO-DATE
:facebook:generateDebugResources UP-TO-DATE
:facebook:mergeDebugResources UP-TO-DATE
:facebook:processDebugManifest UP-TO-DATE
:facebook:processDebugResources UP-TO-DATE
:facebook:generateDebugSources UP-TO-DATE

BUILD SUCCESSFUL

Total time: 4.053 secs

Gradle类路径为com.android.tools.build:gradle:0.12.+

来自项目的app文件夹中的build.gradle文件,请求:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion '20'
    defaultConfig {
        applicationId 'com.bandsintown'
        minSdkVersion 10
        targetSdkVersion 20
        versionCode 113
        versionName '4.6.5'
    }
    buildTypes {
        release {
            debuggable false
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        checkReleaseBuilds false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:20.+'
    compile 'com.nineoldandroids:library:2.4.+'
    compile 'com.viewpagerindicator:library:2.4.1@aar'
    compile 'com.google.android.gms:play-services:5.+'
    compile project(':facebook')
}

实际上,我注意到复制它时,第一行是错误的。它曾经是apply plugin: 'android'但是已经针对这个新版本的Gradle进行了更改,而不是您使用com.android.application看到的内容。但是,更改此行仍然会给我带来同样的问题。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

从0.6.1升级到0.8.0时,我遇到了类似的问题 不幸的是,我并不是100%确定我是如何解决它的,但我认为以下救了我:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ibma.ibmaapp"
    android:versionCode="2"
    android:versionName="1.0">
    <uses-sdk
        android:minSdkVersion="19"
        android:targetSdkVersion="19"
        android:maxSdkVersion="19" />
...
</manifest>
  1. 在AndroidManifest.xml中添加sdkVersion(见上文)
  2. 点击菜单&#34;文件&#34; &GT; &#34;无效的缓存/重新启动...&#34;
  3. 如果没有修复,请打开SDK Manager并卸载&#34; Android L&#34;和#34; Android W4.4&#34;包(如果已安装)
  4. 再次检查,也许重复第2步

相关问题