Android源代码生成器:错误:无法找到基本名称消息的包.AndroidJpsBundle

时间:2017-07-28 05:55:44

标签: android android-studio android-studio-3.0

我之前使用Android Studio v2.3制作模块,这没关系。现在我改为Android Studio v3.0,当我尝试Make Module时,它显示以下错误:

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:1263)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:940)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1012)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:903)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:736)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:384)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:192)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:295)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:236)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

3 个答案:

答案 0 :(得分:22)

我遇到了同样的问题,这对我有用,所以让我知道它是怎么回事。

  1. 右键点击您的项目并打开Module Settings
  2. 点击facets。
  3. 添加Android-Gradle并申请。
  4. 关闭并重新打开项目并重建。

答案 1 :(得分:10)

  1. 备份AndroidStudio3.0 \ plugins \ android \ lib \ jps \ * .jar

  2. 将AndroidStudio2.3.3 \ plugins \ android \ lib \ jps \ * .jar复制到 AndroidStudio3.0 \插件\机器人\ lib中\ JPS \ *。罐

答案 2 :(得分:1)

似乎我没有在Android Studio中打开正确的项目目录。我有一个Grande项目,但是当打开[Project Folder]-> [Android]-> [App]作为Android Studio中的现有项目时,它为我解决了这个问题!

当您仅在Android Studio中打开现有项目的[项目文件夹]并尝试编译并生成APK时,它将在上面显示此错误:错误:Android Source Generator。...

因此,请确保您导入了Android Project的正确目录;-)