52 questions
2
votes
1
answer
159
views
Where is specified the highest Java language version that the d8 compiler accepts?
I cannot find the authoritateive answer anywhere.
I know that what d8 is and that it performs desugaring. Basically, up to what Java language version can it desugar?
I found these websites that list ...
0
votes
1
answer
260
views
How to use aar file manually and properly?
I've read How can I build an Android apk without Gradle on the command line? and How to compile an Android app with aapt2 without using any build tools?, but both answers don't seem to align with my ...
2
votes
1
answer
1k
views
java.lang.NullPointerException: Cannot read field "accessFlags" because the return value of "com.android.tools.r8.graph.AppView.definitionFor" is null
Getting this error after updating the Android Gradle Plugin from 7.2.1 to 8.0.2
Android studio - Hedgehog | 2023.1.1 Patch 1
Kotlin version - 1.9.23
Java - 17
Crash log -
Caused by: com.android.tools....
2
votes
1
answer
442
views
Compiling basic Android app without Gradle - d8 errors
I wish to port a small utility I prototyped on Windows as a simple app. I use a 10-year old computer, so from what I gather tools like Gradle and Android Studio would run too slow for me to be able to ...
1
vote
2
answers
10k
views
Android app build error: D8: XXXXXXX is defined multiple times when switching branches
We are facing a peculiar issue while building our Android app. Everything compiles successfully when we develop on one branch. However, as soon as we switch to another branch (any branch other than ...
0
votes
0
answers
403
views
Any solutions to solve NoClassDefFoundError after upgrade to agp 7+?
As I upgraded agp version from 4.1.0 to 7.4.2 (gradle version 7.5.1), a NoClassDefFoundError exception got and the app crashed.
Since I upgraded agp from 4.1.0 to 7.0, dx has deprecated by default and ...
9
votes
4
answers
22k
views
Android R8 Error after updating dependencies
I have updated all of my project dependencies and I'm getting different Errors of R8.
AGPBI: {"kind":"error","text":"java.lang.NullPointerException","...
1
vote
2
answers
1k
views
How to create a dex with D8.bat
I used to create dex file with dx.bat like this :
"c:\SDKs\android\build-tools\32.0.0\dx.bat" --dex
--output=C:\Dev\MagicFoundation\Alcinoe\Tools\AddRJavaToClassesDex\tmp\classes.dex
C:\Dev\...
0
votes
0
answers
30
views
why android compiler generate different MethodRef for same code
i happened to encounter some wired compiled bytecode which i believe both sharing the same source code like below
class SomeWebView extends WebView {
SomeWebView() {
this.getSettings();
...
0
votes
1
answer
195
views
Packaging of jar, so and class files into APK
Problem (shaped like a 'V'):
We having a Java function a() - in a.java (top left of V)
a() calls another local function b() implemented via JNI - b.cpp (bottom of V)
b() creates an instance of java ...
1
vote
1
answer
2k
views
Android Build with command-line tools
I try to understand how a .apk file is built from source code. I know that with Android Studio or with the command gradlew the build can be done easily. The Android Sdk provides multiple tools that ...
2
votes
0
answers
280
views
d8: strange exception when using it from command line
Given i added d8.bat to my PATH, I tried to compile a folder of java classes into classes.dex using the modern tool d8 (which replaced dx). However when I followed the example in the documentation,
dx ...
0
votes
0
answers
196
views
How to keep manifest file with d8 compile tool?
I build a jar for the Android platform with Gradle. When I use the dx command, it works well building a jar with manifest, but dx can't support Java 8 syntax. So I have to change compile tool to d8, ...
3
votes
0
answers
238
views
Generate desugared library for B4A
I'm making an Android library for B4A framework.
Here's the situation:
My Android library uses Java8 features (such as Lambda)
B4A (Basic4Android) uses legacy dex (instead of d8) to make the apps and ...
1
vote
1
answer
502
views
How to add Multidex support to Android d8.bat commandline
I'm using Androids d8 compiler from Delphi, and i need to enable MultiDex. In Android Studio you add the following to your Gradle file:
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
...