Status Update
Comments
vi...@google.com <vi...@google.com>
ac...@google.com <ac...@google.com> #2
set title before set Toolbar as ActionBar
Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
toolbar.settitle("ddidid");
setSupportActionBar(toolbar);
lb...@gmail.com <lb...@gmail.com> #3
Thanks for the answer :-).
I am searching for a solution to change the title some times (E. G. changing view). Or should i use for every fragmant an own toolbar?
lb...@gmail.com <lb...@gmail.com> #4
lb...@gmail.com <lb...@gmail.com> #5
ac...@google.com <ac...@google.com> #6
lb...@gmail.com <lb...@gmail.com> #7
ac...@google.com <ac...@google.com> #8
lb...@gmail.com <lb...@gmail.com> #9
Maybe not just actions before, but also after the app is installed?
This way, at least developers who use Android Studio might be able to use the workarounds you've offered, such as temporarily disable/deny the notification-listener, and after install, enable/grant it again.
It's a good addition regardless of this issue I write, no? Maybe there are other cases that this could be useful .
sj...@gmail.com <sj...@gmail.com> #10
Temp workaround I'm using is to attach a dynamic build suffix to the versionName
in build.gradle
, which will hopefully allow you to continue working without manual commands until there is a fix:
def buildCode = (int)(((new Date().getTime()/1000) - 1451606400) / 10)
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
...
versionName "0.1.${buildCode}"
...
}
}
lb...@gmail.com <lb...@gmail.com> #11
I don't want users to see weird numbers there...
Possible to use it here:
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
debug {
versionNameSuffix "-DEBUG"
pseudoLocalesEnabled true
}
}
?
Maybe with versionNameSuffix , as an additional suffix?
Similar to :
?
Did you check that it works?
Also, why the weird calculation ? Can't you just use the timestamp instead, directly? Or format by date&time?
sj...@gmail.com <sj...@gmail.com> #12
The solution I'm using is just a workaround during app development to get work done, it's not meant to be permanent or used in an actual release to the play store.
lb...@gmail.com <lb...@gmail.com> #13
lb...@gmail.com <lb...@gmail.com> #14
static final def buildTime() {
def df = new SimpleDateFormat("yyyy-MM-dd,HH:mm:ss") // you can change it
df.setTimeZone(TimeZone.getTimeZone("UTC"))
return df.format(new Date())
}
...
buildTypes {
debug {
versionNameSuffix "-DEBUG-" + buildTime()
}
...
It doesn't help with the issue I described. I still need to start the app twice to see new changes. You can try it on the sample I've provided, too.
lb...@gmail.com <lb...@gmail.com> #15
la...@gmail.com <la...@gmail.com> #16
That was me. I noticed it first on Android Studio 4.1.0. But I also don't directly use NotificationListenerService
, so it's possible that around the same time I started using a 3rd party library that uses it.
lb...@gmail.com <lb...@gmail.com> #17
I used this one:
So something after 4.1.0 has changed to cause this issue.
See attached.
It does seem like it's restarted for a split of a second with the old version, but right after that it uses the new code you've updated.
lb...@gmail.com <lb...@gmail.com> #18
ac...@google.com <ac...@google.com> #19
Here are the summary:
1) There is a bug introduced in 4.1.1 that causes applications not restarting despite installing the APK as intended. There is a test / workaround by restarting the application manually. This bug will be fixed in 4.1.2 and it is not found in 4.1.0 nor 4.2+
2) A similar bug (174431980, this one in question) which involves an application that automatically restarts itself if it has certain intent listeners. It would make it appear the application had been killed and relaunched but unfortunately it is not the launch that Studio triggered so the APK might not be fully updated at that time. The workaround is still restarting the application manually. This bug will not be in 4.1.0 and we are still working on a fix.
3) A bug exists in the Canary 2 build (174783087) which would make Run stop pushing changes to API30 devices (even after pressing it again afterward). This has been quickly addressed in Canary 3 build.
Finally 1) and 2) are all timing / race condition related. Changing your build process might or might NOT work. Also if you have having that does not match what was described in the above 3 bugs, we kindly ask you to open a new bug with more detailed description and reproducing steps.
Again, we understand the frustration, we are working hard to address the issues.
lb...@gmail.com <lb...@gmail.com> #20
As for the list of known bugs, is one of those the same as I've found today, on the emulator (doesn't occur on real device), as I wrote on @18 ? If so, please write there.
ac...@google.com <ac...@google.com> #21
We are currently in progress of cherry picking to 4.2. Unfortunately, it might be too late for 4.1
ac...@google.com <ac...@google.com>
lb...@gmail.com <lb...@gmail.com> #22
ac...@google.com <ac...@google.com> #23
jp...@gmail.com <jp...@gmail.com> #24
It's a major pain for sure.. in my case this happens with my Accessibility Service app so I need to force close the app and restart it on the device after I 'run' from Android Studio.
Unfortunately, force closing and restarting an Accessibility Service app removes the accessibility services permission so I have to manually grant it again -- after every re-start from Android Studio..
There's a few work-arounds you can do to help somewhat.. I've got I've got a bash script that stops the app, starts it again and then uses 'adb shell input touchscreen tap X Y' to simulate screen touches to grant accessibility services permission.. it works but not super easy to setup
adb -s $ADB_DEVICE shell am force-stop $PACKAGE
adb -s $ADB_DEVICE shell am start -n $PACKAGE
lb...@gmail.com <lb...@gmail.com> #25
Also, is there a way to overcome what he wrote? I also tried to work on Accessibility Service, and many times I got it revoked.
Is there a command to set an app to have its accessibility enabled?
I know only of "-g" for permissions, and something for notification access. I don't know about using adb to grant accessibility, admin, set as default apps, etc...
Those could be extremely useful in general. Not just in this case as a workaround.
@24 This will work on Windows OS too? I didn't know about "start". This is the opposite of force-stop? This doesn't open some Activity, right? Just changes its state from "stopped" to "started", meaning it's no active and can respond to various OS Intents.
What if instead of this, you try to disable&re-enable ?
lb...@gmail.com <lb...@gmail.com> #26
Granted it's not about notification-access anymore, but still happens.
And I still haven't tested the notification-access issue on the original app that has it.
j....@get.systems <j....@get.systems> #27
currently also no nice solutions, but maybe this helps
Description
Version of Gradle Plugin:
Version of Gradle:
Version of Java:
OS:
Android Studio 4.1.1
Build #AI-201.8743.12.41.6953283, built on November 5, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 3916M
Cores: 12
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true, debugger.watches.in.variables=false
Non-Bundled Plugins: String Manipulation, com.dubreuia, com.thoughtworks.gauge, org.intellij.plugins.markdown, com.intellij.marketplace, org.jetbrains.kotlin
Steps to Reproduce:
1. Have an app that has notification listener (NotificationListenerService) being used.
2. Write something on the log, in the class that extends Application.
3. Choose to install&run the app.
The bug is that many times, the new log won't be shown, and instead you will see the previous state.
See attached.
This was tested on both emulator and Pixel 4, both with Android R.