Status Update
Comments
di...@google.com <di...@google.com>
je...@google.com <je...@google.com>
ga...@google.com <ga...@google.com> #2
Thank you for the report and the supplied dump with the reproduction. I can confirm that the NPE is also present on HEAD, and I will look into it.
Quite a few of the class files in the dump has malformed inner-class attribute, where R8 reports e.g.:
Info in /tmp/tmpo67ucguh/program.jar:ofifmwrrhhmodsc/ψξψξψξξ.class:
Malformed inner-class attribute:
outerTypeInternal: ofifmwrrhhmodsc/ψξψξψξξ
innerTypeInternal: ofifmwrrhhmodsc/ψξψξψξξ$ψξξψξξξ
innerName: ψξψξψξξ$ψξξψξξξ
These are ignored, so they should not be the reason for the NPE, but something to also look into.
ni...@nrbtech.io <ni...@nrbtech.io> #3
Branch: main
commit e59500ca4445f5fb5d2ccc1114acbf66df11d196
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 09:48:55 2023
Insert patched frame instructions in the right place
Fixes:
Change-Id: Iae204ed529f9af5bf5fa3eaacba45128dfa6fd9e
M src/main/java/com/android/tools/r8/graph/LazyCfCode.java
M src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
bi...@google.com <bi...@google.com> #4
Branch: main
commit 780c2e83c8c033e7594d61894fa1b3dbcad6630b
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 09:48:13 2023
Add reproduction of
Bug:
Change-Id: I7573883d6a649eed47b10d7bf0cdea2e11710268
M build.gradle
M src/main/java/com/android/tools/r8/cf/code/frame/UninitializedNew.java
A src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
ni...@nrbtech.io <ni...@nrbtech.io> #5
I will backport this to the 8.0 and 4.0 branches.
bi...@google.com <bi...@google.com> #6
Thank you very much for taking a look at this!
Is this fix related to the nullpointer or the malformed inner-class attributes ?
Do you have a separated ticket for it? Could you share it?
ni...@nrbtech.io <ni...@nrbtech.io> #7
Branch: 4.0
commit 6edb00fb23e41b28d4794cfa69d706d5c5aa3fba
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 16:55:01 2023
Version 4.0.56
Bug:
Change-Id: I88a20fc922ce892d38fa3a34f9a3f1f4714354ae
M src/main/java/com/android/tools/r8/Version.java
ww...@gmail.com <ww...@gmail.com> #8
Branch: 4.0
commit d9215af3b02f64d1207b9ebd63a6925229307b9d
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 16:54:50 2023
Insert patched frame instructions in the right place
Bug:
Change-Id: Iae204ed529f9af5bf5fa3eaacba45128dfa6fd9e
M src/main/java/com/android/tools/r8/graph/LazyCfCode.java
M src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
ww...@gmail.com <ww...@gmail.com> #9
Branch: 4.0
commit 4fda9b9062c871ba0e31cb68d1518b13b993692f
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 16:54:33 2023
Add reproduction of
Bug:
Change-Id: I7573883d6a649eed47b10d7bf0cdea2e11710268
M build.gradle
M src/main/java/com/android/tools/r8/cf/code/frame/UninitializedNew.java
A src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
bi...@google.com <bi...@google.com> #10
Branch: 8.0
commit 6686e7dffea83ea894438b496c065d0a18cda206
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 16:53:01 2023
Version 8.0.37
Bug:
Change-Id: I43a723a94638088d921cd3fb6e22ef6e41f07d5f
M src/main/java/com/android/tools/r8/Version.java
ww...@gmail.com <ww...@gmail.com> #11
Branch: 8.0
commit 57f55fb70aa678a61f9c7ff1826fbc695faeac7d
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 16:52:27 2023
Insert patched frame instructions in the right place
Bug:
Change-Id: Iae204ed529f9af5bf5fa3eaacba45128dfa6fd9e
M src/main/java/com/android/tools/r8/graph/LazyCfCode.java
M src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
bi...@google.com <bi...@google.com>
ni...@nrbtech.io <ni...@nrbtech.io> #12
Branch: 8.0
commit cd00c053222b06bb27fdd90bbed56af9c9ef0744
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 16:51:57 2023
Add reproduction of
Bug:
Change-Id: I7573883d6a649eed47b10d7bf0cdea2e11710268
M build.gradle
M src/main/java/com/android/tools/r8/cf/code/frame/UninitializedNew.java
A src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
[Deleted User] <[Deleted User]> #13
Branch: 4.0
commit d9215af3b02f64d1207b9ebd63a6925229307b9d
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 16:54:50 2023
Insert patched frame instructions in the right place
Bug:
Change-Id: Iae204ed529f9af5bf5fa3eaacba45128dfa6fd9e
M src/main/java/com/android/tools/r8/graph/LazyCfCode.java
M src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
ro...@miquido.com <ro...@miquido.com> #14
Branch: 4.0
commit 4fda9b9062c871ba0e31cb68d1518b13b993692f
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 16:54:33 2023
Add reproduction of
Bug:
Change-Id: I7573883d6a649eed47b10d7bf0cdea2e11710268
M build.gradle
M src/main/java/com/android/tools/r8/cf/code/frame/UninitializedNew.java
A src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
ww...@gmail.com <ww...@gmail.com> #15
Answer to
The malformed inner-class attributes is an issue with the input class files, and they where not related to the NPE. You will have to contact the supplier of the library where they are present if you would like to get rid of the "Info" messages (you will have to run ./gradlew --info ...
to see them). From what I can see the issue is that the innerName: ψξψξψξξ$ψξξψξξξ
should have been innerName: ψξξψξξξ
.
bi...@google.com <bi...@google.com> #16
Branch: 4.0
commit 49f738ff7377dacecf0fca39fec5146beb251ea3
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 18:14:15 2023
Version 4.0.57
Backport test to 4.0 test APIs.
Bug:
Change-Id: Iecf03a2ad9dcdbd53e6c572d2f08915248435682
M src/main/java/com/android/tools/r8/Version.java
M src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
ww...@gmail.com <ww...@gmail.com> #17
Branch: 8.0
commit c11ddf096e58245c2c67514dc9e5a2098dd8f705
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 18:16:54 2023
Version 8.0.38
Backport test to 8.0 test APIs.
Bug:
Change-Id: I35ae6d701fa92a6a7a734f9c0296d1383fed8e20
M src/main/java/com/android/tools/r8/Version.java
M src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
bi...@google.com <bi...@google.com> #18
bi...@google.com <bi...@google.com> #19
ww...@gmail.com <ww...@gmail.com> #20
ww...@gmail.com <ww...@gmail.com> #21
I don't know if these are really related but even though you can sync project from the second try - native code breakpoints don't work even with Dual
debug type. Moreover LLDB doesn't even attach on its own when debug type is Detect Automatically
.
It was not a problem with 7.1.X and Bumblebee.
bi...@google.com <bi...@google.com> #22
That is weird cause I am able to make it work by adding it to your sample project.
bi...@google.com <bi...@google.com> #23
Fixed with I905dd70a2e7ccf05b3a7da1c83e2af4260b71ece and the fix will be available since 8.0-alpha01.
ka...@gmail.com <ka...@gmail.com> #24
While I am building I receive:
"A build operation failed.
Failed to create service 'com.android.build.gradle.internal.profile.AnalyticsService_704aac9b-2502-42f4-80cd-cccdba9bb437'.
Failed to create service 'com.android.build.gradle.internal.profile.AnalyticsService_704aac9b-2502-42f4-80cd-cccdba9bb437'.
Could not create an instance of type com.android.build.gradle.internal.profile.AnalyticsService.
Cannot query the value of this property because it has no value available."
Details:
Android Studio version: Android Studio Electric Eel | 2022.1.1
OS: Windows 10
Java versions: Oracle OpenJDK 11.0.10, Azul Zulu version 13.0.10
And some more details below:
I would like to mention that my Android Studio project contains two projects on the same root as it is mentioned in the previous comments (multi-root project).
Here are some more tests I did:
Windows 10, Android Studio Electric Eel | 2022.1.1, Gradle 7.5, AGP 7.4.0 => The problem as it is described above
Windows 10, Android Studio Electric Eel | 2022.1.1, Gradle 7.5, AGP 7.3.1 => Build and run successfully
Windows 10, Android Studio Electric Eel | 2022.1.1, Gradle 7.4, AGP 7.3.1 => Build and run successfully
Mac OS Monterey 12.6.2, Android Studio Electric Eel | 2022.1.1, Gradle 7.5, AGP 7.4.0 => The problem as it is described above
Mac OS Monterey 12.6.2, Android Studio Electric Eel | 2022.1.1, Gradle 7.5, AGP 7.3.1 => Build and run successfully
Mac OS Monterey 12.6.2, Android Studio Dolphin | 2021.3.1, Gradle 7.5, AGP 7.4.0 => The problem as it is described above
Mac OS Monterey 12.6.2, Android Studio Dolphin | 2021.3.1, Gradle 7.5, AGP 7.3.1 => Could not run due to the reason that AGP 7.3.1 requires as minimum the Gradle 7.4
As I can understand, the problem is on the AGP 7.4.0 which tries to create the AnalyticsSettings instance.
As a current solution to my problem, I am using Gradle 7.5 with AGP 7.3.1 in the latest Android Studio versions(Dolphin and Electric) for my project.
Regards,
ga...@linecorp.com <ga...@linecorp.com> #25
Fixed with I905dd70a2e7ccf05b3a7da1c83e2af4260b71ece and the fix will be available since 8.0-alpha01.
Is it possible to backport this change on stable version(AGP 7.4)?
pa...@gmail.com <pa...@gmail.com> #26
@ww... in #20
> I couldn't add exact code you've provided because of the error Unresolved reference: setOptedIn.
This happens when the class is not on the right classpath.
It's housed in com.android.tools.analytics-library:shared:30.4.0.
Which is a transitive dependency of com.android.tools:sdk-common:30.4.0.
In one of the AGP 7.x versions a lot of dependencies (including sdk-common) have been moved from compile to runtime scope in the POM, so they moved from compileClasspath to runtimeClasspath configuration in Gradle.
So, in Kotlin we need the class be present and compileClasspath, Groovy doesn't care as it's interpreted and does exactly the reflective code you posted.
I couldn't make it work with this hack, tried many-many ways, but only synced by editing analytics.settings.
dm...@mapbox.com <dm...@mapbox.com> #27
The only workaround that worked was to disable `Send usage statistics to google` in settings, changing flag manually in `~./android/analytics.settings` had no effect and AS kept overwriting the file.
pa...@gmail.com <pa...@gmail.com> #28
Edit the file and make it read-only. It will warn on every AGP build, and on AS startup you'll get a weird opt-in dialog, but AS won't be able to change it back.
fu...@gmail.com <fu...@gmail.com> #29
Fixed with I905dd70a2e7ccf05b3a7da1c83e2af4260b71ece and the fix will be available since 8.0-alpha01.
Is it possible to backport this change on stable version(AGP 7.4) or gradle(7.5+)?
bi...@google.com <bi...@google.com> #30
Unfortunately, it is not an option
da...@gmail.com <da...@gmail.com> #31
Please advise if possible on a solution. Thank you in advance.
[Deleted User] <[Deleted User]> #32
// id "com.android.application"
// id "kotlin-android"
// id "dev.flutter.flutter-gradle-plugin"
//}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
//apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.example.notification_fiebase"
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
multiDexEndabled true
// TODO: Specify your own unique Application ID (
applicationId "com.example.notification_fiebase"
// You can update the following values to match your application needs.
// For more information, see:
minSdkVersion 19
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.google.firebase:firebase-bom:32.7.1"
}
'flutter' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
solve that issue
Description
DESCRIBE THE ISSUE IN DETAIL:
While Gradle 7.2 works fine, and Gradle 7.4 works fine in AS 2021.1.1, Gradle 7.4 fails in AS 2021.3.1 Canary 7 with the following exception:
STEPS TO REPRODUCE:
ATTACH SCREENSHOTS/RECORDINGS OF THE ISSUE
ATTACH LOG FILES (Select Help > Show Log in Files, or Show Log in Finder on a Mac)
Build: AI-213.6777.52.2113.8305692, 202203160046,
AI-213.6777.52.2113.8305692, JRE 11.0.13+0-b1751.21-8125866x64 JetBrains s.r.o., OS Mac OS X(aarch64) v12.3, screens 3456.0x2234.0, 5120.0x2880.0; Retina
AS: Dolphin | 2021.3.1 Canary 7; Kotlin plugin: 213-1.6.20-M1-release-for-android-studio-AS6777.52; Android Gradle Plugin: 7.1.2; Gradle: 7.4; Gradle JDK: version 11.0.13; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: 3.18.1-g262b901, from PATH: 3.22.0