Android KeystoreHelper defaultDebugKeystoreLocation() throw NullPointerException - android

I need to update Android Gradle plugin (com.android.tools.build:gradle) from 4.1.2 to 7.1.3.
After change version my project've broken(doesn't building) with next logs:
Caused by: java.lang.NullPointerException
at com.android.ide.common.signing.KeystoreHelper.defaultDebugKeystoreLocation(KeystoreHelper.java:81)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at loadSettings_c8tjztikeo3fv7c4oqcvl02uk.run(/place where I keep project/build_scripts/loadSettings.gradle:19)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
I've tried next:
Clean Project
Invalidate cache and restart
Check environment variables(ANDROD_SDK_ROOT etc)
Remove and reinstall sdk(SDKManager)
Nothing helps.
My environment:
macOS Monterey 12.4
Java 11
Android Studio Dolphin | 2021.3.1 Patch
1 Build #AI-213.7172.25.2113.9123335, built on September 30, 2022
Gradle 7.6
Kotlin 1.7.21
target and compile sdk 31

Related

Cause: invalid type code: 1C for android studio gradle [duplicate]

This question already has answers here:
How can I fix this error in Android Studio: "Cause: invalid type code: 00"?
(6 answers)
Closed 2 months ago.
My Android studio working fine but after update the plugin I am getting below error. I tried updating the JDK and reinstall the Android Studio but still facing the same error.
This is sync tab error.
Cause: invalid type code: 1C
This is the build tab error
020-06-04 19:13:09,207 [1650474] ERROR - nsions.impl.ExtensionPointImpl - Android Studio 4.0 Build #AI-193.6911.18.40.6514223
2020-06-04 19:13:09,207 [1650474] ERROR - nsions.impl.ExtensionPointImpl - JDK: 1.8.0_242-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-06-04 19:13:09,207 [1650474] ERROR - nsions.impl.ExtensionPointImpl - OS: Windows 10
2020-06-04 19:13:09,207 [1650474] ERROR - nsions.impl.ExtensionPointImpl - Plugin to blame: CSV Plugin version: 2.11.1
2020-06-04 19:13:09,208 [1650475] ERROR - nsions.impl.ExtensionPointImpl - While loading class net.seesharpsoft.intellij.plugins.csv.CsvFileTypeOverrider: net/seesharpsoft/intellij/plugins/csv/CsvFileTypeOverrider has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: net.seesharpsoft.intellij.plugins.csv]
com.intellij.diagnostic.PluginException: While loading class net.seesharpsoft.intellij.plugins.csv.CsvFileTypeOverrider: net/seesharpsoft/intellij/plugins/csv/CsvFileTypeOverrider has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: net.seesharpsoft.intellij.plugins.csv]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:223)
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:167)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getImplementationClass(ExtensionComponentAdapter.java:80)
at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.createInstance(ExtensionComponentAdapter.java:39)
at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.java:63)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:442)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:429)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.access$100(ExtensionPointImpl.java:33)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl$1.next(ExtensionPointImpl.java:337)
at com.intellij.openapi.extensions.impl.ExtensionProcessingHelper.computeSafeIfAny(ExtensionProcessingHelper.java:39)
at com.intellij.openapi.extensions.ExtensionPointName.computeSafeIfAny(ExtensionPointName.java:60)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.getFileTypeByFile(FileTypeManagerImpl.java:742)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.getFileTypeByFile(FileTypeManagerImpl.java:736)
at com.intellij.openapi.vfs.VirtualFile.getFileType(VirtualFile.java:328)
at com.intellij.psi.SingleRootFileViewProvider.<init>(SingleRootFileViewProvider.java:59)
at com.intellij.psi.impl.PsiFileFactoryImpl.trySetupPsiForFile(PsiFileFactoryImpl.java:111)
at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:95)
at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:48)
at org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementFactoryImpl.createDummyFile(GroovyPsiElementFactoryImpl.java:375)
at org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementFactoryImpl.createGroovyFile(GroovyPsiElementFactoryImpl.java:621)
at org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementFactoryImpl.createExpressionFromText(GroovyPsiElementFactoryImpl.java:169)
at org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory.createExpressionFromText(GroovyPsiElementFactory.java:146)
at com.android.tools.idea.gradle.dsl.parser.groovy.GroovyDslUtil.createLiteral(GroovyDslUtil.java:375)
at com.android.tools.idea.gradle.dsl.parser.groovy.GroovyDslParser.convertToPsiElement(GroovyDslParser.java:147)
at com.android.tools.idea.gradle.dsl.parser.elements.FakeElement.lambda$createPsiElement$0(FakeElement.java:66)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:807)
at com.android.tools.idea.gradle.dsl.parser.elements.FakeElement.createPsiElement(FakeElement.java:66)
at com.android.tools.idea.gradle.dsl.parser.elements.FakeElement.produceValue(FakeElement.java:118)
at com.android.tools.idea.gradle.dsl.model.CachedValue.updateValue(CachedValue.java:68)
at com.android.tools.idea.gradle.dsl.model.CachedValue.getValue(CachedValue.java:53)
at com.android.tools.idea.gradle.dsl.parser.elements.GradleDslSimpleExpression.getValue(GradleDslSimpleExpression.java:119)
at com.android.tools.idea.gradle.dsl.model.ext.GradlePropertyModelImpl.extractAndGetValueType(GradlePropertyModelImpl.java:523)
at com.android.tools.idea.gradle.dsl.model.ext.GradlePropertyModelImpl.getValueType(GradlePropertyModelImpl.java:108)
at com.android.tools.idea.gradle.dsl.model.ext.PropertyUtil.resolveModel(PropertyUtil.java:130)
at com.android.tools.idea.gradle.dsl.model.ext.ResolvedPropertyModelImpl.resolveModel(ResolvedPropertyModelImpl.java:245)
at com.android.tools.idea.gradle.dsl.model.ext.ResolvedPropertyModelImpl.toString(ResolvedPropertyModelImpl.java:168)
at com.android.tools.idea.gradle.structure.model.android.PsDeclaredLibraryAndroidDependency.getSpec(PsLibraryAndroidDependency.kt:51)
at com.android.tools.idea.gradle.structure.model.PsDeclaredLibraryDependency$DefaultImpls.toKey(PsLibraryDependency.kt:36)
at com.android.tools.idea.gradle.structure.model.android.PsDeclaredLibraryAndroidDependency.toKey(PsLibraryAndroidDependency.kt:43)
at com.android.tools.idea.gradle.structure.model.PsDeclaredDependencyCollection.refreshParsedDependencies(PsDependencyCollection.kt:176)
at com.android.tools.idea.gradle.structure.model.PsDeclaredDependencyCollection.refresh(PsDependencyCollection.kt:171)
at com.android.tools.idea.gradle.structure.model.android.PsAndroidModule.init(PsAndroidModule.kt:90)
at com.android.tools.idea.gradle.structure.model.PsModuleCollection.update(PsModuleCollection.kt:110)
at com.android.tools.idea.gradle.structure.model.PsModuleCollection.update(PsModuleCollection.kt:38)
at com.android.tools.idea.gradle.structure.model.android.PsCollectionBase.refresh(PsCollectionBase.kt:44)
at com.android.tools.idea.gradle.structure.model.PsProjectImpl.applyChanges(PsProjectImpl.kt:111)
at com.android.tools.idea.gradle.structure.configurables.PsContextImpl.applyChanges(PsContextImpl.kt:218)
at com.android.tools.idea.gradle.structure.configurables.ProjectPerspectiveConfigurable.apply(ProjectPerspectiveConfigurable.kt:49)
at com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.apply(ProjectStructureConfigurable.kt:384)
at com.intellij.openapi.options.newEditor.ConfigurableEditor.apply(ConfigurableEditor.java:324)
at com.intellij.openapi.options.newEditor.ConfigurableEditor.apply(ConfigurableEditor.java:135)
at com.intellij.openapi.options.newEditor.SettingsDialog.applyAndClose(SettingsDialog.java:197)
at com.intellij.openapi.options.newEditor.SettingsDialog.doOKAction(SettingsDialog.java:193)
at com.android.tools.idea.structure.dialog.ProjectStructureConfigurable$showDialog$dialog$1.doOKAction(ProjectStructureConfigurable.kt:294)
at com.intellij.openapi.ui.DialogWrapper$OkAction.doAction(DialogWrapper.java:1881)
at com.intellij.openapi.ui.DialogWrapper$DialogWrapperAction.actionPerformed(DialogWrapper.java:1834)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at com.chrisrm.idea.ui.MTButtonUI$ButtonHighlighter.mouseReleased(MTButtonUI.java:387)
at java.awt.Component.processMouseEvent(Component.java:6550)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
at java.awt.Component.processEvent(Component.java:6315)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4899)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4721)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.C
This is an issue with the JDK version being too recent, as shown in this line:
CsvFileTypeOverrider: net/seesharpsoft/intellij/plugins/csv/CsvFileTypeOverrider has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I had a similar bug where Gradle sync died immediately with the Cause: invalid type code: 1C error. Switching the JDK from OpenJDK 14 I installed to the integrated JDK that comes bundled with Android Studio fixed the issue.
To switch the JDK version, go to File > Project Structure, select "SDK Location" on the left sidebar, and under "JDK Location" select the dropdown arrow and then select Embedded JDK: C:\Users\user\...
New Java versions need new Gradle ones.
Go to Project Structure then change:
Plugin version to the newest stable one. ( Mine is 4.0.0 and 4.0.1).
Gradle Version to ...( Mine is 6.6.1).
That is all. It is fixed. You can try it.
i have same problem. i try to change the version of gradle at project tab of dependences.but i ran to other problems .anyway maybe it will work for you

Robolectric tests fail in terminal, succeed in Android Studio

I've recently started to work on a new project, which includes Robolectric-based unit tests.
When ran from Android Studio (v3.6), all the tests pass successfully.
Strangely, some of the tests fail when I'm running them using ./gradlew test from terminal with very intimidating error:
java.lang.VerifyError: Stack map does not match the one at exception handler 56
Exception Details:
Location:
com/google/android/gms/measurement/internal/zzjy.zza(Landroid/net/Uri;)Landroid/os/Bundle; #56: astore
Reason:
Type 'java/lang/String' (current frame, locals[5]) is not assignable to null (stack map, locals[5])
Current Frame:
bci: #51
flags: { }
locals: { 'com/google/android/gms/measurement/internal/zzjy', 'android/net/Uri', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String' }
stack: { 'java/lang/UnsupportedOperationException' }
Stackmap Frame:
bci: #56
flags: { }
locals: { 'com/google/android/gms/measurement/internal/zzjy', 'android/net/Uri', 'java/lang/String', 'java/lang/String', 'java/lang/String', null }
stack: { 'java/lang/UnsupportedOperationException' }
Bytecode:
// redacted..
Exception Handler Table:
bci [16, 53] => handler: 56
Stackmap Table:
same_frame(#6)
full_frame(#53,{Object[#2],Object[#145],Object[#129],Object[#129],Object[#129],Object[#129]},{})
full_frame(#56,{Object[#2],Object[#145],Object[#129],Object[#129],Object[#129],Null},{Object[#143]})
full_frame(#74,{Object[#2],Object[#145],Object[#129],Object[#129],Object[#129],Object[#129]},{})
same_frame(#104)
append_frame(#128,Object[#172])
same_frame(#143)
same_frame(#160)
same_frame(#177)
append_frame(#201,Object[#129])
append_frame(#225,Object[#129])
append_frame(#249,Object[#129])
append_frame(#273,Object[#129])
append_frame(#297,Object[#129])
full_frame(#300,{Object[#2],Object[#145],Object[#129],Object[#129],Object[#129],Object[#129]},{})
at com.google.android.gms.measurement.internal.zzfl.<init>(com.google.android.gms:play-services-measurement-impl##17.1.0:42)
at com.google.android.gms.measurement.internal.zzfl.zza(com.google.android.gms:play-services-measurement-impl##17.1.0:285)
at com.google.firebase.analytics.FirebaseAnalytics.getInstance(com.google.android.gms:play-services-measurement-api##17.1.0:9)
// redacted..
at org.robolectric.android.internal.AndroidTestEnvironment.lambda$installAndCreateApplication$0(AndroidTestEnvironment.java:276)
at org.robolectric.android.internal.AndroidTestEnvironment$$Lambda$45/1286999442.run(Unknown Source)
at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:75)
at org.robolectric.android.internal.AndroidTestEnvironment.installAndCreateApplication(AndroidTestEnvironment.java:276)
at org.robolectric.android.internal.AndroidTestEnvironment.setUpApplicationState(AndroidTestEnvironment.java:169)
at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:301)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:243)
at org.robolectric.internal.SandboxTestRunner$2$$Lambda$28/968645498.run(Unknown Source)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89)
at org.robolectric.internal.bytecode.Sandbox$$Lambda$29/1700079137.call(Unknown Source)
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)
Why the tests pass in Android Studio, but fail in terminal?
Why the tests pass in Android Studio, but fail in terminal?
It's because there's a JDK version mismatch between the one that's used when invoked from Android Studio versus the one that's used when invoked from the terminal.
Which JDK version used by Gradle when invoked from the terminal?
When ran from terminal, Gradle uses a version defined in JAVA_HOME - which on my machine pointed to (older version) 1.8.0-51.
Which JDK version used by Gradle when invoked from Android Studio?
Starting from version 2.2, a copy of the latest OpenJDK comes bundled with Android Studio.
In example, Android Studio 3.6 uses OpenJDK v1.8.0-212.
The JDK version you want Gradle to use when running your tasks from Android Studio can be found/set at Project Structure > SDK Location > JDK Location. By default, it is configured to use the bundled OpenJDK version.
How did I solved the error?
In order to reproduce the errors in Android Studio, I've changed the JDK Location to JAVA_HOME, ran the tests (from Android Studio) again, and voila! the errors I've seen only in terminal now appear in Android Studio as well.
To resolve the failures I've seen when ran the tests from terminal, I've updated the JDK pointed by JAVA_HOME to latest (1.8.0-251), and now tests pass both in Android Studio and when ran using gradlew from terminal.

LLDB exception after updating to Android Studio 3.1

After updating to Android Studio from 3.0.1 to 3.1, and updating all plugins and SDK tools i am no longer able to debug my native application.
The error is 'Execution finished' (ExecutionFinishedException) which is raised in LLDB.
LLDB version is 3.1.4508709 (which is the latest).
If i try and debug with an earlier version of LLDB i get an error LLDB is missing (or similar).
Error details:
Execution finished
com.intellij.execution.ExecutionException: Execution finished
at com.jetbrains.cidr.execution.ExecutionResult.get(ExecutionResult.java:38)
at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver.getProtobufClient(LLDBDriver.java:90)
at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver.executeConsoleCommand(LLDBDriver.java:1109)
at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver.executeConsoleCommand(LLDBDriver.java:1103)
at com.android.tools.ndk.run.lldb.AndroidLLDBDriver.loadStartupScripts(AndroidLLDBDriver.java:321)
at com.android.tools.ndk.run.lldb.AndroidLLDBDriver.commonLoad(AndroidLLDBDriver.java:132)
at com.android.tools.ndk.run.lldb.AndroidLLDBDriver.loadForAttach(AndroidLLDBDriver.java:248)
at com.android.tools.ndk.run.AndroidNativeAppDebugProcess.prepareTarget(AndroidNativeAppDebugProcess.java:101)
at com.android.tools.ndk.run.AndroidNativeDebugProcessImpl.doLoadTarget(AndroidNativeDebugProcessImpl.java:123)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess.lambda$start$0(CidrDebugProcess.java:314)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$MyCommandProcessor.consume(CidrDebugProcess.java:703)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$MyCommandProcessor.consume(CidrDebugProcess.java:693)
at com.intellij.util.concurrency.QueueProcessor.lambda$null$0(QueueProcessor.java:93)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:246)
at com.intellij.util.concurrency.QueueProcessor.lambda$wrappingProcessor$1(QueueProcessor.java:93)
at com.intellij.util.concurrency.QueueProcessor.lambda$null$3(QueueProcessor.java:226)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:246)
at com.intellij.util.concurrency.QueueProcessor.lambda$startProcessing$4(QueueProcessor.java:226)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
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)
Caused by: com.intellij.execution.ExecutionFinishedException: Execution finished
at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver$4.processTerminated(LLDBDriver.java:248)
at sun.reflect.GeneratedMethodAccessor139.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.execution.process.ProcessHandler$5.invoke(ProcessHandler.java:239)
at com.sun.proxy.$Proxy16.processTerminated(Unknown Source)
at com.intellij.execution.process.ProcessHandler$4.run(ProcessHandler.java:196)
at com.intellij.execution.process.ProcessHandler$TasksRunner.execute(ProcessHandler.java:272)
at com.intellij.execution.process.ProcessHandler.notifyTerminated(ProcessHandler.java:177)
at com.intellij.execution.process.ProcessHandler.notifyProcessTerminated(ProcessHandler.java:173)
at com.intellij.execution.process.BaseOSProcessHandler.onOSProcessTerminated(BaseOSProcessHandler.java:192)
at com.intellij.execution.process.OSProcessHandler.onOSProcessTerminated(OSProcessHandler.java:89)
at com.intellij.execution.process.BaseOSProcessHandler$2$1.consume(BaseOSProcessHandler.java:155)
at com.intellij.execution.process.BaseOSProcessHandler$2$1.consume(BaseOSProcessHandler.java:140)
at com.intellij.execution.process.ProcessWaitFor$1.run(ProcessWaitFor.java:66)
... 5 more
Last 2 lines from gdb-server log:
1522263876.330623627 NativeProcessLinux.cpp:MonitorCallback got exit signal(0x002EA90B) , tid = 25279 (is not main thread)
1522263876.330640793 NativeProcessLinux.cpp:MonitorCallback tid = 25279 handling non-main thread exit (%s)
Anyone else experienced this or know of a fix?
A workaround is to re-install Android Studio 3.0.1. This can be done alongside the latest version (see https://developer.android.com/studio/preview/install-preview.html).
For me, debugging c++ code then works again (in Android Studio 3.0.1) even though it is using the same versions of SDK tools (e.g. LLDB v3.1.4508709).

How to import Android Studio (1.0) project into Intellij 14 Ultimate

I have an Android Studio project and I would like to start using Intellij 14 Ultimate to take advantage of some of the cool features it has to offer. When I try to open my project I get a message saying:
Gradle Sync
Version 1.0.0-rc4 of the Android Gradle plug-in requires Gradle null or newer. A local Gradle distribution was not found ....
Click 'OK' to use the Gradle wrapper.
I click ok and it tries to Sync, but fails. Here is what the error console says:
Gradle version 2.2 is required. Current version is 2.1. If using the gradle wrapper, try editing the distributionUrl in ~gradle-wrapper.properties~
I modify the file click "Try Again"
Nothing happens. Here is what is in the log file:
2014-12-13 09:40:23,845 [ 572317] ERROR - llij.ide.plugins.PluginManager - null
java.lang.AssertionError
at com.android.tools.idea.gradle.project.PreSyncChecks.attemptToUpdateGradleVersionInWrapper(PreSyncChecks.java:175)
at com.android.tools.idea.gradle.project.PreSyncChecks.ensureCorrectGradleSettings(PreSyncChecks.java:72)
at com.android.tools.idea.gradle.project.PreSyncChecks.canSync(PreSyncChecks.java:53)
at com.android.tools.idea.gradle.project.GradleProjectImporter.doImport(GradleProjectImporter.java:439)
at com.android.tools.idea.gradle.project.GradleProjectImporter.doRequestSync(GradleProjectImporter.java:219)
at com.android.tools.idea.gradle.project.GradleProjectImporter.access$000(GradleProjectImporter.java:77)
at com.android.tools.idea.gradle.project.GradleProjectImporter$2.run(GradleProjectImporter.java:184)
at com.intellij.ui.AppUIUtil.invokeLaterIfProjectAlive(AppUIUtil.java:77)
at com.android.tools.idea.gradle.project.GradleProjectImporter.requestProjectSync(GradleProjectImporter.java:191)
at com.android.tools.idea.gradle.project.GradleProjectImporter.requestProjectSync(GradleProjectImporter.java:166)
at com.android.tools.idea.editors.ProjectSyncStatusNotificationProvider$ProjectImportFailedNotificationPanel$1.run(ProjectSyncStatusNotificationProvider.java:105)
at com.intellij.ui.EditorNotificationPanel$2.hyperlinkActivated(EditorNotificationPanel.java:95)
at com.intellij.ui.HyperlinkAdapter.hyperlinkUpdate(HyperlinkAdapter.java:28)
at com.intellij.ui.HyperlinkLabel.fireHyperlinkEvent(HyperlinkLabel.java:187)
at com.intellij.ui.HyperlinkLabel.processMouseEvent(HyperlinkLabel.java:120)
at java.awt.Component.processEvent(Component.java:6281)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4489)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:748)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:573)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 14.0.2 Build #IU-139.659.2
2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - JDK: 1.7.0_71
2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM
2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - Vendor: Oracle Corporation
2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X
2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - Last Action: $Copy
I've also tried importing the project and get similar results. Any ideas?
Idea support pointed me to this:
https://youtrack.jetbrains.com/issue/IDEA-134118
Basically changing my gradle dependency fixed it
//For Android Studio
//classpath 'com.android.tools.build:gradle:1.0.0-rc4'
// For Intellij
classpath 'com.android.tools.build:gradle:0.14.4'
Resync and success!
I had the same thing happening to me tonight, however it provided me with a link to download the latest Gradle dependency. I downloaded it and it solved all of my problems, it will probably solve all of your's too!
This might be a recent solution, I upgraded to 14.0.3 and it solved the problem.

Android Studio : Could not create plugin of type 'AppPlugin'

I know that there are a lot of similar questions, but no one answer works for me.
Android Studio 0.8.0
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+' (the minimum supported version - from tip)
}
Gradle 1.4
------------------------------------------------------------
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.3 compiled on April 8 2014
Ivy: non official version
JVM: 1.7.0_55 (Oracle Corporation 24.51-b03)
OS: Linux 3.13.0-29-generic i386
What went wrong:
A problem occurred evaluating project
> Could not create plugin of type 'AppPlugin'.
Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AppPlugin'.
at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:65)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:106)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:854)
at org.gradle.api.Project$apply.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
at org.gradle.api.Script$apply.callCurrent(Unknown Source)
at build_6m1kibqbisaqktcdt8jnr2gj31.run /build.gradle:9)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
... 32 more
Caused by: java.lang.NoClassDefFoundError: org/gradle/tooling/provider/model/ToolingModelBuilderRegistry
at org.gradle.api.internal.DependencyInjectingInstantiator.selectConstructor(DependencyInjectingInstantiator.java:97)
at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:58)
at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:63)
... 45 more
Caused by: java.lang.ClassNotFoundException: org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
... 48 more
Are you really using Gradle 1.4? Only Gradle 1.10, 1.11 and 1.12 are supported at the moment. Either download a new Gradle version (as far as I know 2.0 is not supported, yet) or change the Gradle wrapper to one of the mentioned versions.

Categories

Resources