Verified
Status Update
Comments
uc...@google.com <uc...@google.com> #2
Can you share a sample project to reproduce this issue.
ez...@gmail.com <ez...@gmail.com> #3
implementation 'com.getbase:floatingactionbutton:1.10.1'
<com.getbase.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
fab.title = "Hello World"
}
}
D:\Android_Projects\Testing\app\src\main\java\net\inferno\testing\MainActivity.kt: (12, 13): Unresolved reference: title
Android Studio can't recognize FloatingActionButton, it's underlined with a red error line.
I believe the issue is in any repo that used support libraries in it.
If I remove android.useAndroidX=true flag, it works, but only in some projects, in others it gives me "Compilation failed to complete", here is a sample :
https://issuetracker.google.com/issues/79642295
<com.getbase.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
fab.title = "Hello World"
}
}
D:\Android_Projects\Testing\app\src\main\java\net\inferno\testing\MainActivity.kt: (12, 13): Unresolved reference: title
Android Studio can't recognize FloatingActionButton, it's underlined with a red error line.
I believe the issue is in any repo that used support libraries in it.
If I remove android.useAndroidX=true flag, it works, but only in some projects, in others it gives me "Compilation failed to complete", here is a sample :
uc...@google.com <uc...@google.com> #4
Not reproduced, can you share a complete sample project to reproduce this issue.
li...@gmail.com <li...@gmail.com> #5
I'm facing a similar problem. I create a new Kotlin project, refactor to AndroidX, add okhttp3 as dependency, build an okhttp client, make project, it shows "Unresolved reference: okhttp3". okhttp doesn't depend on support libraries, so I believe all external libraries are failing.
Only Kotlin project fails, pure Java project compiles successfully.
It only fails on Windows 10 in Android Studio, but compiles OK on Linux (Travis CI environment). I assume it's a Windows specific problem.
Only Kotlin project fails, pure Java project compiles successfully.
It only fails on Windows 10 in Android Studio, but compiles OK on Linux (Travis CI environment). I assume it's a Windows specific problem.
ou...@gmail.com <ou...@gmail.com> #6
Hi I have the same problem.
I published a sample project here (with stacktrace in README):https://github.com/ouattararomuald/androidx-bug
OS: Windows 8.1 Pro
Android Studio: 3.2 Canary 15
I published a sample project here (with stacktrace in README):
OS: Windows 8.1 Pro
Android Studio: 3.2 Canary 15
uc...@google.com <uc...@google.com> #8
Reproduced in 3.2 Canary 15, Windows 10
je...@google.com <je...@google.com>
hu...@google.com <hu...@google.com> #9
Thanks for the reports and sample project!
@Filip: This seems to be an issue with the Jetifier tool (on Windows). I'm attaching the aars before and after being jetified. Steps to reproduce:
- Use the project athttps://github.com/ouattararomuald/androidx-bug , observe that the build fails.
- Now set android.enableJetifier=false in gradle.properties to turn off support from the AGP.
- Put the jetified-stetho-1.5.0.aar file into the app\libs directory and replace implementation 'com.facebook.stetho:stetho:1.5.0' with implementation files('libs\\jetified-stetho-1.5.0.aar'). Observe that the build also fails.
- Put the original stetho-1.5.0.aar file into the app\libs directory and replace implementation 'com.facebook.stetho:stetho:1.5.0' with implementation files('libs\\stetho-1.5.0.aar'). Observe that the build passes this time.
@Filip: This seems to be an issue with the Jetifier tool (on Windows). I'm attaching the aars before and after being jetified. Steps to reproduce:
- Use the project at
- Now set android.enableJetifier=false in gradle.properties to turn off support from the AGP.
- Put the jetified-stetho-1.5.0.aar file into the app\libs directory and replace implementation 'com.facebook.stetho:stetho:1.5.0' with implementation files('libs\\jetified-stetho-1.5.0.aar'). Observe that the build also fails.
- Put the original stetho-1.5.0.aar file into the app\libs directory and replace implementation 'com.facebook.stetho:stetho:1.5.0' with implementation files('libs\\stetho-1.5.0.aar'). Observe that the build passes this time.
hu...@google.com <hu...@google.com> #10
Attached are the extracted contents of the two aars as viewed from the IDE. The hierarchical vs flattened structures of classes inside classes.jar probably explains why the jetified one is not usable.
hu...@google.com <hu...@google.com> #11
@Filip: More users are hitting this issue. While we're working on a fix, is it possible to publish the standalone-jetifier tool so users can temporarily work around the issue?
pa...@gmail.com <pa...@gmail.com> #12
I think the issue is only with the libraries having packages starting with "com" (like "com.facebook.stetho.BuildConfig" in stetho) and is not the case with libraries having packages starting with something else (like "io.reactivex.Observable" in rxJava2)
hu...@google.com <hu...@google.com> #13
@12: Any libraries that do not reference Android support libraries will not be jetified and therefore will not have this issue. "io.reactivex.rxjava2:rxjava" is probably in this category.
pa...@gmail.com <pa...@gmail.com> #14
Ohh true let me verify this with other libs
pa...@gmail.com <pa...@gmail.com> #15
Yes you were right Crouton with pacjkage prefix "de" also shows similar behaviour as stetho
pa...@google.com <pa...@google.com> #16
We have a fix for the issue. Will post update here once we know when the fix is going to be available.
je...@google.com <je...@google.com> #17
downgrading to P1, as it should not block beta1 or branching.
pa...@gmail.com <pa...@gmail.com> #18
pardon?
pa...@google.com <pa...@google.com> #19
We have fixed the issue and it should be available in Android gradle plugin 3.2.0-beta01
lb...@gmail.com <lb...@gmail.com> #20
@19 Really hope so.
pa...@gmail.com <pa...@gmail.com> #21
@19 When will it be available?
[Deleted User] <[Deleted User]> #22
I believe 3.2.0-beta01 gradle plug-in will be released alongside with Studio 3.2 beta 1 release.
Is there any chance we have this fix before? I'm unable to build project on my primary laptop more than a month
Is there any chance we have this fix before? I'm unable to build project on my primary laptop more than a month
ph...@sprylab.com <ph...@sprylab.com> #23
Please release this in alpha 18
vl...@gmail.com <vl...@gmail.com> #24
*
ko...@gmail.com <ko...@gmail.com> #25
When Android gradle plugin 3.2.0-beta01 will be released?
ha...@gmail.com <ha...@gmail.com> #26
So it is *not* in alpha18 (just tested) :-(
ph...@gmail.com <ph...@gmail.com> #27
:(
ra...@gmail.com <ra...@gmail.com> #28
Any updates when it will be released?
hu...@google.com <hu...@google.com> #29
We have pushed the fix already and it's now in the testing/releasing cycle. All I know is 3.2.0-beta01 will come after 3.2.0-alpha18. Sorry for the wait.
[Deleted User] <[Deleted User]> #30
It still exists in 3.2.0-beta01
li...@gmail.com <li...@gmail.com> #31
3.2.0-beta01 fixed my project.
au...@gmail.com <au...@gmail.com> #32
Still doesn't work on 3.2.0-beta01
ha...@gmail.com <ha...@gmail.com> #33
fixed for me in 3.2.0-beta01
lb...@gmail.com <lb...@gmail.com> #34
Seems fine on my 3 spare time apps. Wonder if will be good on the large apps at the office
pa...@google.com <pa...@google.com> #35
Re: #30,#32: Are you sure you are hitting the same bug?
au...@gmail.com <au...@gmail.com> #36
No, it's actually a different bug related to jetifier, sorry.
ko...@gmail.com <ko...@gmail.com> #37
Fixed. Thanks!
Description
AI-181.4668.68.32.4763614, JRE 1.8.0_152-release-1136-b03x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 1920x1080
Android Gradle Plugin: 3.2.0-alpha14
Gradle: 4.7
NDK: from local.properties: (not specified); latest from SDK: (not found);
LLDB: LLDB 3.1 (revision: 3.1.4508709)
CMake: from local.properties: (not specified); latest from SDK: 3.6.0-rc2; from PATH: (not found);
IMPORTANT: Please read
After updating to AndroidX, external libraries can't be compiled anymore. Anything depending on support-libraries just won't compile, keeps saying "unresolved reference"
Imports:
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog
import com.wdullaer.materialdatetimepicker.time.TimePickerDialog
Errors:
Unresolved reference: time
Unresolved reference: TimePickerDialog
Unresolved reference: setText
Unresolved reference: text
Unresolved reference: DatePickerDialog
'onTimeSet' overrides nothing
'onDateSet' overrides nothing