Status Update
Comments
ne...@gmail.com <ne...@gmail.com> #2
sh...@google.com <sh...@google.com>
ka...@google.com <ka...@google.com> #4
ne...@gmail.com <ne...@gmail.com> #5
ka...@google.com <ka...@google.com> #6
Android Studio version: 0.8.12
buildToolsVersion 21.0.1
Gradle 1.11
ka...@google.com <ka...@google.com> #7
--set-max-idx-number=<value>
Unfortunately changing the default is not a solution since the linearAlloc limit can be reached at very different levels depending on the classes hierarchy and other criteria.
In addition for most applications, moving to multidex will only help to workaround the linearalloc limit for the installation. But the application will still crash against the same limit at execution. The only working use case where I know multidex can help with linearalloc is when the apk does not contains one application but distinct pieces running in separate process.
an...@google.com <an...@google.com> #8
It's nice to know about that command line option. I do not see it in the output of 'dx --help', might be good to add that.
I'm not very familiar with the 'linearAlloc limit' issue outside of the context of the dexopt step. My sample app is able to run once the lower idx value is set, although I do not actually call into any of the library code that is bundled with the app. I assume it's undefined when/if the 'linearAlloc limit' will be hit in a large application on gb.
I'm a bit confused as to the platform compatibility of multidex given the 'linearAlloc limit' bug. What specific versions of Android are supported? The multidex code implies back to v4 (
ad...@salesforce.com <ad...@salesforce.com> #9
The linearalloc limit is reached when loading classes. At install time dexopt is loading all classes contained in the dex so it's facing the limit immediately. At execution the limit may be reached after some delay dependending of the usage you have of the packaged classes. If you face it at install time but not at execution, this means you never trigger the loading of some classes. In a real application those never loaded classes should have been shrinked away manually or by Proguard. The exception is when there are different groups of classes in the dex files used in separate process.
About multidex library supported versions I've merged recently a change to try to be clearer
The summary is that the library should work down to API 4 (Donut), but below ICS applications will probably be hit by the linearalloc limit
ka...@google.com <ka...@google.com> #10
dexOptions {
additionalParameters = ['--multi-dex', '--set-max-idx-number=40000']
}
sl...@pentacomp.pl <sl...@pentacomp.pl> #11
ka...@google.com <ka...@google.com> #14
Thank you for attaching the file. Could I please ask you to Sync your project and check this file again to see if its content changed by any chance ?
sl...@pentacomp.pl <sl...@pentacomp.pl> #15
No, the content stayed the same. Also i checked other project i have on disk and was not yet opened in AS Ladybug (or even with new UI if that matters) - there wasn't file until I opened project in new AS and it was created with the same content.
ka...@google.com <ka...@google.com> #16
I need some more details about your project setup to be able to reproduce the issue. Is there a possibility to share a repro project for this by any chance please ?
sl...@pentacomp.pl <sl...@pentacomp.pl> #17
Unfortunately I cannot share my project, but I was able to reproduce it just by creating new empty activity project (attached).
I also tried to remove all "AndroidStudio###" folders in appdata/local/google
and appdata/roaming/google
to make sure it is like new user experience. Still got runConfigurations.xml
file created with the same content.
Here are also details from Android Studio about page:
Android Studio Ladybug | 2024.2.1
Build #AI-242.21829.142.2421.12409432, built on September 24, 2024
Runtime version: 21.0.3+-12282718-b509.11 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 8
Registry:
ide.experimental.ui=true
ka...@google.com <ka...@google.com> #18
As a workaround, if you delete the runConfigurations.xml
file and re-open your project, you will not be seeing this issue anymore. We will work on a fix for this for the next release. Sorry for the inconvenence.
ba...@gocity.com <ba...@gocity.com> #19
I tried the workaround above but I'm still getting the issue. What should actually be added/removed in the runConfigurations.xml
for the JUnit option to no longer be presented?
ka...@google.com <ka...@google.com> #20
Ok For now you can replace the file's content with this
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>
Then do same of closing and re-opening your project ( No need for Sync). We're working on a fix and trying to get it available ASAP.
ra...@gmail.com <ra...@gmail.com> #21
ka...@google.com <ka...@google.com> #22
We have a WIP fix for this and we will try have it available for PATCH 2 latest.
Thank you.
kr...@gmail.com <kr...@gmail.com> #23
ka...@google.com <ka...@google.com> #24
We're actually working to get this in for patch 1 ths week, just bare with us! thank you
ka...@google.com <ka...@google.com> #25
Thank you for your patience. This issue's fix will now be available in the LB.1 Patch 1 which is set to be released on Monday 14th, of October.
ka...@google.com <ka...@google.com>
an...@google.com <an...@google.com> #26
The fixes for this issue are now also available in:
- Android Studio Ladybug | 2024.2.1 Patch 1
- Android Gradle Plugin 8.7.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
an...@google.com <an...@google.com> #27
Further fixes for this issue are now available in:
- Android Studio Ladybug Feature Drop | 2024.2.2 Canary 6
- Android Gradle Plugin 8.8.0-alpha06
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Description
Summary:
Tests running in an Android Studio project with the Ladybug Feature Drop (build #AI-242.21829.142.2422.12345034) fail to initialize classes located outside of the "test" source set. This results in a
java.lang.NoClassDefFoundError
when attempting to use these classes within tests.Expected Behavior:
Tests should be able to initialize and use classes from any source set within the project, including the "main" source set.
Actual Behavior:
java.lang.NoClassDefFoundError
.Steps to Reproduce:
com.example. MyClass
).MyClass testObject = new MyClass();
).Observed Result:
The test fails with a
java.lang.NoClassDefFoundError
forcom.example.MyClass
.Additional Information:
System Information:
Non-Bundled Plugins:
Severity:
This bug can be considered a blocker for development as it prevents tests from interacting with core project functionality.