Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android Studio错误:常量太多_Java_Android_Eclipse - Fatal编程技术网

Java Android Studio错误:常量太多

Java Android Studio错误:常量太多,java,android,eclipse,Java,Android,Eclipse,我的项目在Java类和许多xml文件中有许多字符串。我使用Multidex进行此操作,但当我尝试构建APK时,出现以下错误: Information:Gradle tasks [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidDatabind

我的项目在Java类和许多xml文件中有许多字符串。我使用Multidex进行此操作,但当我尝试构建APK时,出现以下错误:

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidDatabindingAdapters10Rc5Library UP-TO-DATE
:app:prepareComAndroidDatabindingLibrary10Rc5Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42300Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:dataBindingProcessLayoutsDebug UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:dataBindingExportBuildInfoDebug UP-TO-DATE
:app:compileDebugJavaWithJavac
C:\WoW17\WoW17\app\build\generated\source\r\debug\com\xxx\test\R.java
Error:(12127, 25) error: too many constants
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Information:BUILD FAILED
Information:Total time: 3 mins 5.842 secs
Information:2 errors
我的gradle文件:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.xxx.test"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 13
        versionName "1.66"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding {
        enabled = true
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.android.support:multidex:1.0.0'

}

我以前使用过eclipse,但无法使用它进行多索引,所以我改用Android Studio。我有35000个字符串,还有xml和Java文件。有什么解决方法吗?

对于JAVA_HOME变量中没有抛出的问题,这里有一个操作指南:

35k字符串?在
strings.xml
中声明?是,支持x7语言