2014-09-30 96 views
1

Android Studio不提供“捆绑”类的所有方法。Android Studio - 支持包

当我想使用.getString()时,它显示我为错误。我不知道为什么 !?!?!

这是我的gradle产出:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 20 
    buildToolsVersion "20.0.0" 

    defaultConfig { 
     applicationId "test.android.com.test" 
     minSdkVersion 14 
     targetSdkVersion 19 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      runProguard false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile project(':facebook') 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.nineoldandroids:library:2.4.+' 
    compile 'com.android.support:support-v13:20.0.+' 
    compile 'com.google.android.gms:play-services:4.2.42' 
    compile 'com.mcxiaoke.volley:library:1.0.6' 
} 
+0

你确定你有正确的'import'声明?也许你正在拉一些名为'Bundle'的类,而不是你期望的类。 – CommonsWare 2014-09-30 21:49:32

+0

是的,我正在使用正确的导入。导入android.os.Bundle; – 2014-09-30 21:53:17

+0

你正在收到什么具体的错误信息? – CommonsWare 2014-09-30 21:54:14

回答

0

最后,我找到了解决办法。如果某人在这里遇到同样的问题,那就去。

变化来自:

compileSdkVersion 20 
buildToolsVersion "20.0.0" 

更改为:

compileSdkVersion 19 
buildToolsVersion "19.0.0"