这是我将Android Studio从3.4升级到3.5后遇到的一个问题。现在,以前可以正常工作的项目失败,并显示以下错误:
Gradle同步失败:com / android / tools / idea / gradle / project / sync / issues / UnhandledIssuesReporter(名称错误:com / android / tools / idea / gradle / project / sync / issues / UnhandledIsstesReporter)
错误日志异常:
[SearchTask] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting
[SearchTask] WARN - ConfigurableExtensionPointUtil - use other group instead of unexpected one: project.propCompiler
[SearchTask] WARN - ConfigurableExtensionPointUtil - use other group instead of unexpected one: project.propCompiler
[entQueue-0] WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
[entQueue-0] WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
[entQueue-0] WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
[entQueue-0] WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
[ thread 22] INFO - e.project.sync.GradleSyncState - Started setup of project 'My Application 3'.
[entQueue-0] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SETUP_STARTED
[ thread 22] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 28 Platform' (C:\Users\Jonathan\AppData\Local\Android\sdk) to module 'app'
[entQueue-0] INFO - pl.ProjectRootManagerComponent - project roots have changed
[ thread 22] INFO - e.project.sync.GradleSyncState - Gradle sync failed: com/android/tools/idea/gradle/project/sync/issues/UnhandledIssuesReporter (wrong name: com/android/tools/idea/gradle/project/sync/issues/UnhandledIsstesReporter) (29 s 205 ms)
[ating Pool] WARN - .idea.model.MergedManifestInfo - getMergedManifest failed Manifest merger failed : Attribute intent-filter#action:name:android.accounts.AccountAuthenticator@priority at AndroidManifest.xml requires a placeholder substitution but no value for <priority> is provided.
[entQueue-0] WARN - .idea.model.MergedManifestInfo - getMergedManifest failed Manifest merger failed : Attribute intent-filter#action:name:android.accounts.AccountAuthenticator@priority at AndroidManifest.xml requires a placeholder substitution but no value for <priority> is provided.
[entQueue-0] WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
[entQueue-0] WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
[entQueue-0] WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
[entQueue-0] WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
[ thread 25] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 9ms; general responsiveness: ok; EDT responsiveness: ok
[ thread 22] WARN - ject.sync.ng.SyncResultHandler - Gradle sync failed
java.lang.NoClassDefFoundError: com/android/tools/idea/gradle/project/sync/issues/UnhandledIssuesReporter (wrong name: com/android/tools/idea/gradle/project/sync/issues/UnhandledIsstesReporter)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:306)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:302)
at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:271)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:183)
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:136)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:49)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.setUpProject(SyncResultHandler.java:156)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.onSyncFinished(SyncResultHandler.java:86)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.lambda$onCompoundSyncModels$5(SyncResultHandler.java:267)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:312)
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)
我将我的项目的gradle文件中的gradle插件版本从3.4.2
更新为3.5.0
:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
然后我又遇到了一个错误:
Gradle同步失败:支持的最低Gradle版本为5.4.1。当前版本是5.1.1。如果使用gradle包装器,请尝试将... \ StudioProjects \ BlueView \ gradle \ wrapper \ gradle-wrapper.properties中的distributionUrl编辑为gradle-5.4.1-all.zip
因此,我按照建议的方式进行了操作,并将gradle-wrapper.properties
文件修改为:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
我已将项目与gradle文件进行了同步,并在下载了新版本的gradle之后,再次失败,并出现了相同的错误:
Gradle同步失败:com / android / tools / idea / gradle / project / sync / issues / UnhandledIssuesReporter(名称错误:com / android / tools / idea / gradle / project / sync / issues / UnhandledIsstesReporter)
我使缓存无效并重新启动了Android Studio。还是没有运气。
最后,我尝试创建一个全新的项目。全新的项目模板的构建也失败了。
我在硬盘上搜索了这个神秘的UnhandledIsstesReporter
文件,但没有找到。
答案 0 :(得分:1)
我认为我应该删除Android Studio并重新安装。
导出设置
我在Window的删除列表中找不到Android Studio,因此我运行了C:\Program Files\Android\Android Studio\uninstall.exe
我手动删除了以下内容:
C:\Users\<User>\.AndroidStudio3.5\
C:\Users\<User>\.Android\
C:\Users\<User>\.gradle\
我重新安装了Android Studio,现在可以使用了。
我导入了在卸载前保存的设置,但仍然可以使用。
答案 1 :(得分:0)
不要卸载任何东西,很难再次安装所有这些。我也遇到同样的问题,我只是从AVD中删除了我的模拟器,然后选择了另一个模拟器,然后转到项目结构,更改了您喜欢使用的API。并且如果您安装了两个API或SDK,则从sdk管理器中删除无用的代码。
答案 2 :(得分:0)
首先,请确保您不要过度劳累,或者将其保存在某个地方。
然后运行:
git reset --hard origin master
(或其他名称),对于我来说是:
git reset --hard origin develop
此外,这就是我解决问题的方式。您的问题可能有不同的解决方案。
以下是您的问题的其他一些潜在解决方案。您可以按任意顺序尝试:
答案 3 :(得分:0)