简体   繁体   English

更新至3.1.2版后,Android Studio编译问题

[英]Android Studio compilation issue after update to ver 3.1.2

I update Android Studio to version 3.1.2 我将Android Studio更新到版本3.1.2

在此处输入图片说明

I performed all the updates recommended by the IDE 我执行了IDE建议的所有更新

Initially I got the error 最初我得到了错误

Error:Cannot run program "C:\\Program Files\\Android\\Android Studio\\jre\\bin\\java" (in directory "C:\\Users\\chosun.AndroidStudio3.1\\system\\compile-server"): CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running. 错误:无法运行程序“ C:\\ Program Files \\ Android \\ Android Studio \\ jre \\ bin \\ java”(在目录“ C:\\ Users \\ chosun.AndroidStudio3.1 \\ system \\ compile-server”中):CreateProcess错误= 216 ,此版本的%1与您正在运行的Windows版本不兼容。 Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher 检查计算机的系统信息以查看是否需要该程序的x86(32位)或x64(64位)版本,然后与软件发行商联系。

This turned out to be the error reported by java.exe at "C:\\Program Files\\Android\\Android Studio\\jre\\bin\\". 原来是java.exe在“ C:\\ Program Files \\ Android \\ Android Studio \\ jre \\ bin \\”报告的错误。 My OS is Windows 7 32 bits but apparently the installed java is 64 bits (not sure how this happened, as far as I know I didn't mess with the java installation, unless the android studio update somehow downloaded it? Isn't it supposed to automatically detect the required java version?) 我的操作系统是Windows 7 32位,但显然安装的Java是64位(据我所知,我并没有搞砸Java安装,除非我通过Android Studio更新以某种方式下载了它,所以不知道这是怎么回事?应该自动检测到所需的Java版本?)

Anyway, after reading this post , I had a look at File -> project structure 无论如何,看完这篇文章后 ,我看看File-> project structure

在此处输入图片说明

I can neither find the "Use embedded JDK" mentioned in the other post, not the gradle.properties file 我找不到另一篇文章中提到的“使用嵌入式JDK”,找不到gradle.properties文件。

在此处输入图片说明

Edit: Playing around with the options in Project structure: 编辑:玩弄项目结构中的选项:

在此处输入图片说明

The shown value for project SDK gives the following error during compile: 项目SDK的显示值在编译过程中产生以下错误:

Error:Android Source Generator: Error: Can't find bundle for base name messages.AndroidJpsBundle, locale en_US
java.util.MissingResourceException: Can't find bundle for base name messages.AndroidJpsBundle, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
    at org.jetbrains.jps.android.AndroidJpsBundle.getBundle(AndroidJpsBundle.java:22)
    at org.jetbrains.jps.android.AndroidJpsBundle.message(AndroidJpsBundle.java:32)
    at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.runAaptCompiler(AndroidSourceGeneratingBuilder.java:971)
    at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.doBuild(AndroidSourceGeneratingBuilder.java:210)
    at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.build(AndroidSourceGeneratingBuilder.java:114)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1246)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:923)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:995)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:886)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:719)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:371)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:308)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:138)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:235)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

What is the problem here and how can I fix this? 这是什么问题,我该如何解决?

--- Extra question --- -额外问题-

I don't use Android Studio regularly, but sometimes need to make small android apps as tools in order to test the other actual projects I am working on. 我不经常使用Android Studio,但有时需要制作小型android应用程序作为工具,以测试我正在从事的其他实际项目。 However, every other week Android Studio seems to recommend an update, and every time I update it one thing or another seems to break, or something in the interface seems to change, or the IDE itself runs slower. 但是,每隔一周Android Studio似乎会建议您进行一次更新,每次更新时,似乎一件事或另一件事都中断了,或者界面中的某些内容似乎发生了变化,或者IDE本身运行速度较慢。

Why is Android Studio so problematic? 为什么Android Studio如此有问题? Is there some basic setting that I should have set in order to not break android studio after every update? 我应该设置一些基本设置以便在每次更新后都不会破坏android studio吗? Or is it better to just make sure I set everything so that it works, then never update it again? 还是只是确保我将所有内容都设置为可以正常工作,然后再也不更新它更好?

What is the safest and easiest way to set up android studio for someone who does not use it on a regular basis? 为不定期使用Android Studio的人设置最安全,最简单的方法是什么?

As I can understand your problem i will suggest some point hope it will help you 据我了解,您会提出一些建议,希望对您有所帮助

firstly uninstall your jdk and download jdk 32 bit as you are using windows 7 32 bit. 首先卸载您的jdk并像使用Windows 7 32位一样下载jdk 32位。 and down-lode the latest version of android studio and when you are installing the android studio pls turn of your internet connection when your installation will be done you can down-lode the recommended emulator if you want otherwise you can use your mobile phone as a emulator. 然后下载最新版本的android studio,当您安装android studio时,请在完成安装后打开互联网连接,如果需要的话,您可以下载推荐的模拟器,否则可以将手机用作仿真器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM