Status Update
Comments
lb...@gmail.com <lb...@gmail.com> #2
Unable to make field private static final java.util.Map java.lang.ProcessEnvironment.theCaseInsensitiveEnvironment accessible: module java.base does not "opens java.lang" to unnamed module @436e852b
It doesn't tell where the issue is, what is the issue, and how to fix it.
Just bad compatibility...
cm...@google.com <cm...@google.com>
je...@google.com <je...@google.com>
cm...@google.com <cm...@google.com> #3
Those both sound like issues opening older projects with newer JDKs or dependencies that use newer bytecode.
Which version of Studio are you using (help->about control-c to copy the details)?
And please can you attach the full stacktraces of the errors you're seeing? (either from the command line or from the idea log - help->show log in files)
lb...@gmail.com <lb...@gmail.com> #4
About IDE info:
Android Studio Giraffe | 2022.3.1 Canary 10
Build #AI-223.8836.35.2231.9762515, built on March 17, 2023
Runtime version: 17.0.6+0-b2043.56-9746777 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 10048M
Cores: 12
Registry:
external.system.auto.import.disabled=true
debugger.watches.in.variables=false
ide.text.editor.with.preview.show.floating.toolbar=false
Non-Bundled Plugins:
cn.jxzhang.plugin.json-formatter (1.4)
com.intellij.marketplace (223.8836.56)
com.dubreuia (2.3.0)
Show As ... (1.0.3)
String Manipulation (9.7.1)
GenerateSerialVersionUID (3.0.3)
idea.plugin.protoeditor (223.8214.6)
com.dethlex.numberconverter (1.5.0)
izhangzhihao.rainbow.brackets (2023.2.6)
com.ppismerov.ksvu (0.0.1)
com.google.mad-scorecard (1.2)
net.aquadc.mike.plugin (0.28)
com.developerphil.adbidea (1.6.8)
GenerateSerializationHelpers (1.0.6)
lb...@gmail.com <lb...@gmail.com> #5
cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'extension-level'. One of '{layoutlib}' is expected.
cvc-complex-type.2.4.d: Invalid content was found starting with element 'base-extension'. No child element is expected at this point.
cvc-complex-type.2.4.d: Invalid content was found starting with element 'extension-level'. No child element is expected at this point.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{codename, tag}' is expected.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'extension-level'. One of '{tag}' is expected.
cm...@google.com <cm...@google.com> #6
The logs in 5 are annoying but harmless from older AGP dealing with newer Android SDK
lb...@gmail.com <lb...@gmail.com> #7
See attached video.
It also says this now:
"
Unable to load class 'javax.xml.bind.JAXBException'.
This is an unexpected error. Please file a bug containing the idea.log file.
"
cm...@google.com <cm...@google.com> #8
I haven't looked at the details yet, but you likely need to change the version of the JDK used for Gradle to 8 in studio settings
lb...@gmail.com <lb...@gmail.com> #9
Also, where do I do this?
I don't think studio settings even has this... Isn't it per-project?
I searched in the settings for "jdk", and I didn't see anything related to what you wrote. Same goes to searching "gradle" there.
cm...@google.com <cm...@google.com> #10
The setting is in Settings in Giraffe Canary 10, and it is per project, although I'm not sure how you configure it before opening a project - Madalin what's the state there?
lb...@gmail.com <lb...@gmail.com> #11
I tried CTRL+ALT+S (File->settings) and I don't see those there.
Perhaps you are talking about some configuration file? If so, please offer it on a nice UI too.
vm...@google.com <vm...@google.com> #12
To open the Gradle Settings
you have different ways:
- Settings > Build Execution Deployment > Build Tools > Gradle
- File > Project Structure > SDK Location > Gradle Settings
- Searching for action
Change Gradle JDK Location
lb...@gmail.com <lb...@gmail.com> #13
Attached video about this.
And as you can see, it's sadly per project. I can't find a way to set it as default. It's actually even showing there is a default, but it doesn't use it by default when I create a new project.
Each time I create a new project, it chooses something wrong, and I have to choose the embedded one (which is marked as default) again, and again.
It takes now about 3 minutes or so to create a Hello-world project on Canary.
vm...@google.com <vm...@google.com> #14
Let's recap a bit the different points mentioned:
Using the searching bar on Settings isn't displaying Gradle JDK:
- That's correct, however, seems to be quite buggy and sometimes searching by
Gradle
works. In any case, let's use this to improve it.new ticket
Why we are not using
Android Studio default jdk
:
- This
jdk.table
entry is a hardcoded naming causing issues especially when used in different machines that may have their jdk.table pointing to a completely different JDK version. For this reason, we migrate away from them using the standard vendor + version i.e jbr-17. For this reason, we just have them for compatibility reasons with older project/AS versions
Each time I create a new project, it chooses something wrong.
- There was an issue regarding this that was addressed as part of this internal bug
273803862
, and is caused by the fact of using the firstjdk.table
entry for the new created projects. This was addressed by using theEmbedded JDK
and those changes are going to land inAndroid Studio G Beta 1
. In addition, in the near future we are going to allow users to modify this selection from "Default project structure" option.
I hope this helped to clarify, in any case, will be great to keep things separate to avoid mixing different bugs for the same report.
lb...@gmail.com <lb...@gmail.com> #15
Why can't there be a button "Set this as default" which will set it for every new project created, and also change to it in case there is an issue related to gradle when you open an existing project?
Such a thing should exist in other places, too.
For me, for example, I always choose "show Logcat automatically" and "Clear log before launch" in the run-configuration. I have to set it for every project I create/open...
vm...@google.com <vm...@google.com> #16
As a workaround for your problem with new created projects, you can manually delete your Android studio jdk.table.xml
from JavaSDK
type. Here is a sample about those paths:
macOS: ~/Library/Application Support/Google/AndroidStudio-VERSION/options/jdk.table.xml
linux: ~/.config/Google/AndroidStudio-VERSION/options/jdk.table.xml
windows: %APPDATA%\Google\AndroidStudio-VERSION\options\jdk.table.xml
As mentioned a fix will land in Android Studio G Beta 1
addressing this issue for new created projects.
Regarding your second point, the Default project structure
is already present under File > New Project Setup
allowing users to define their default SDK and NDK. For consistency reasons were added to that specific UI, considering that the JDK selected in the Gradle Settings
only applies to the selected Gradle root but users may have projects with multiple Gradle roots.
In any case, please feel free to create any feature request ticket that will be reviewed and discussed properly keeping this ticket for stuff only related to its title. Thank you
lb...@gmail.com <lb...@gmail.com> #17
vm...@google.com <vm...@google.com> #18
On the APPDATA
is for example C:\Users\YourUserName\AppData\Roaming
:
%APPDATA%\Google\AndroidStudio-VERSION\options\jdk.table.xml
lb...@gmail.com <lb...@gmail.com> #19
Choosing on AndroidStudioPreview2022.3 which seems the latest for canary (how is it 2022?), I deleted the file jdk.table.xml there and then started the IDE.
Then it asked me which JDK to use for gradle.
Then as it opened an existing project, it marked plenty of things in red, related to view-binding, as if they don't exist. Restarting the IDE fixed it.
For a new project, the issue of needing to change gradle JDK version is gone.
In any case, the original issue that I talked about needs fixing.
Please also improve the settings and backward compatibility.
vm...@google.com <vm...@google.com> #20
This exception is linked with JDK < 17
, on studio version using JDK 17. I was able to reproduce it on a sample project with the following configuration:
JDK 11
Gradle 7.2.0
AGP 4.2.2
The project builds properly from the command line and as a workaround, you need to update your project to the most recent AGP/Gradle version that require JDK 17. In any case, a fix will land soon on AS H Canary 2
and will also be cherrypicked on AS G Beta 3
. Please feel free to retest the mentioned versions. Thank you
lb...@gmail.com <lb...@gmail.com> #21
I see this a lot, that an "old" project (can even be just 1 year old) can't be opened anymore, and requires various manual steps while the IDE doesn't help much at all, showing "random" errors without any useful clue about what's wrong.
Maybe offer for all build-errors (or at least those that IDE fails to offer a good quick-fix, or when we tried its quick-fix, and it still failed) an automatic check that gets added, to upgrade what you've written (gradle and AGP).
ja...@gmail.com <ja...@gmail.com> #24
Caused by: java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9
at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:281)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:707)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:425)
at com.android.build.gradle.tasks.DependenciesAnalyzer.visitClass(DependenciesAnalyzer.kt:70)
This issue is because:
class DependenciesAnalyzer {
private val asmVersion = Opcodes.ASM7
}
Description
Example attached here.
Please have a better backward compatibility on the IDE, offer proper information that we can do something about it, and offer a quick-fix for each case that is known.