Same code from support7Demos behaves different on different devices on AppCompat DayNight Mode 23.2.0 - android-appcompat

I have downloaded the Android Support 23.2.0 and imported support7Demos under directory /Android/sdk/extras/android/support/samples/Support7Demos without making any changes. After importing the necessary dependencies, it builds successfully and generate an apk. I installed the apk on Smartisan T1 with API 19. The day night mode works as expected. But it does not work on Nexus 5 with API 23.
Please be noticed that the code is from the Android official Support V7 sample, I did not make any changes at all.
The same apk installed on different devices work different.
This is the link to download the apk to check it out.
You could also check out the two videos that recorded to see the difference.
Is it a bug? And if it is a bug, is there any workaround?

To those who still wonders the answer, here it is :
It's issue with AppCompatActivity.java of support library which is fixed now.
It is the official answer quoted from the bug logged in here

Related

Upload project from android studio to github

i tried to use VCS > Import into version control > Share project on GitHub. https://snipboard.io/aTBxe9.jpg
However i got an error https://snipboard.io/6Eashw.jpg . then i used https://stackoverflow.com/a/27701083/15334005 and followed all the steps yet none of my files appear on github.
https://snipboard.io/7sSbcq.jpg
i would share any further information required. if someone provide me an updated ist of instruction to be followed since both github and android studio have changed w.r.t previous answer i promise to update the steps for newer version and changes below this line as i learn to do it for use of future people.
Will update my answer as i learn and will keep this answer updated wrt newer version and changes for future users.

Cannot build a project due to play-services-base-17.1.0.aar transformation error

So basically I haven't opened my Android Studio project for almost a year and this time was the time for it to be opened and built. After updating Android Studio and all of the project's plugins, I finally reach this error:
Execution failed for task ':app:processDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform play-services-base-17.1.0.aar (com.google.android.gms:play-services-base:17.1.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: C:\Users\Me\.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0.
> AAPT2 aapt2-4.1.1-6503028-windows Daemon #0: Unexpected error during compile 'C:\Users\Me\.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0\res\drawable-xhdpi-v4\common_google_signin_btn_text_dark_normal_background.9.png', attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
I hope someone could help me resolve this issue. Thanks in advance.
update 07 May 2021
With Android Studio 4.2 and the corresponding android gradle plugin v4.2.0 (which requires gradle 6.7.1) the build now works for me also on my older AMD.
So I guess the problem has been fixed :)
(would be great if someone else can confirm via comment)
original answer
Hi have exactly the same issue.
The project builds on 2 of 3 tested PCs. The only difference I see is, that is not working on an older AMD processor. The PCs its working with have both Intel CPUs (an older i7, 2. Gen, and a new i7). All three PCs are running with Windows 10 Pro.
My dev environment is set up equally on all 3 PCs.
I hope this information helps to find a maybe better solution.
The only solution I found is to go back to a previous version of the Gradle plugin and Gradle itself.
In gradle-wrapper properties I defined Gradle version 6.1.1
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
And in the project build.gradle I set version 4.0.2
classpath 'com.android.tools.build:gradle:4.0.2'
Try:
Invalidate Cache / Restart
Clean Project
Rebuild Project
Along same lines: I too am getting this same error but oddly, my project is stored on OneDrive so I can access it/modify it from different locations. The SAME project builds, installs and runs with no issue at one location (with my phone connected to computer), but the error shown above takes place when accessing the same files from the other location (with the same phone connected).
The same version of Android Studio is being used at both locations as well. This was not an issue with this same project a few days ago (i.e. - it ran properly from both locations until recently)
The solution offered previously here does not fix the issue.
Would not normally put this response here but thought perhaps my experience with the same error message could help shed some light on what is happening.
the same topic is discussed here. I have the same behavior the same project builds without a problem on i7. But produces an error on an old AMD processor.

Compiler Error: Failed to read file attributes for .../Resources/Images.xcassets

I recently updated to the latest version of XCode and Xamarin Xamarin.iOS 10.0.0.1 (29910bb) running Visual Studio Professional 2015 Version 14.0.25431.01 Update 3. Both my Mac (build machine) and PC are fully up to date. Now that i have update i am no longer able to compile/build for anything but the simulator.
Compiler Error.
> C:\Program Files
> (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(1028,3): error :
> Failed to read file attributes for
> "/Users/mod/Library/Caches/Xamarin/Resources/Images.xcassets"
As a test i copied the solutions file over to the build machine and with no modifications it compiles and runs any of the targets.
I have also tried deleting the builds directory on the build machine and no help.
Anyone know what the work around is for this?
I have come across is this issue and what seems to possibly be related to on Xamarin Forums. The thing I found in my case was related to image assets within a library I was trying to use. I was able to remove the image assets and relocate to main project and that seemed to resolve the build issue.
This problem, like you have found is very recent. For what's it worth, I have also found that command line tools have numerous issues as they seem to lag behind the GUI provided in either Xamarin Studio or Visual Studio.
Good luck
As mentioned here I had to delete the folder ~/Library/Caches/Xamarin/mtbs/builds on the Mac used for the builds.
After a rebuild it worked again.

AndroidStudio update destroyed everything and I need help as to which way I should rebuild (details of fiasco within)

After this huge mess from one AndroidStudio update, am cleaning everything and starting from scratch.
I'd like to ask if anyone knows if I should go with specific versions of Java.
But first my headache, although I just cleaned my computer of AndroidStudio.
I have Win 10 64 bit
HAD AndroidStudio 1.51 (it said it was JRE:1.7.0_79-b15 amd64)
After the update I had a "Unsupported major.minor version 52.0" error
Following some posts I upgraded the Java on my machine.
First "1.8.0_74" but AndroidStudio couldn't find the JDK directory, so I installed "1.8.0_73" and AndroidStudio found the JDK directory. But then I started getting rendering errors but with Rendering Problems Exception raised during
rendering: com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;
Anyway, that's it. This has become such a tragedy that I would rather start from scratch, but if anyone could point me as to the proper (steps) of which way I should go, I would really appreciate it.
Thanks ahead,
Sergio
I met this issue when I updated the api android 23 N (preview). In xml editor, change the Api to render into Api 23 android 6.0 and Autimatically Pick best.This would solve the problem.
refer: link
Yes.. i also faced same problem,I have resolved with changing the version to api 23.generally it will take best/latest version ,in my case its set to N preview.

Android Wear: Google Play services out of date. Requires x but found y

I have an Android Wear app that I'm trying to migrate from Eclipse to Android Studio. It's working (more or less) on my LG G Watch, but when run on my Moto 360 I get the following message in logcat:
GooglePlayServicesUtil﹕ Google Play services out of date. Requires 6111000 but found 5091534
followed immediately by Connection to Google API client has failed. Running on the emulator gives a similar message:
GooglePlayServicesUtil﹕ Google Play services out of date. Requires 6111500 but found 5077534
It strikes me as odd that the Requires version is slightly different in each case, but there you are.
I've been through the similar questions here on SO, and the answers usually boil down to ensuring that the module's Gradle dependencies are using play-services-wearable rather than just play-services. I've checked this and it appears to be correct; here's the relevant section from my build.gradle file:
dependencies {
compile project(':wearableCommon')
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}
Note that wearableCommon is a library of my own, containing code I'm using in several wearable projects, and it doesn't use GMS.
I'm particularly bothered by the fact that this works on one device but not another. If I didn't have the 360 in-house, I might well have released this code after testing it on my G Watch. I would have then been in the position of trying to debug this in the wild, while simultaneously doing damage control for hundreds of angry 360 owners.
Easiest "fix":
Set your play-services-wearable to specifically look for 5.0.77
compile 'com.google.android.gms:play-services-wearable:5.0.77'
More info:
https://plus.google.com/u/0/101581283591300788111/posts/5bHfmjtvQ6R
I literally had this exact same problem. Wayne is trying to help me out with it. Join the discussion if you like.
The latest version of Google Play Services was rolled out to Android Wear devices recently. The latest SDK update for play-services-wearable requires that your wearable is updated, which is shown in the error message that you report. Make sure you have the latest companion app installed on your phone, and it will install the update to your wearable as well. Make sure that you have your wearable paired with your phone, otherwise it will not be able to update the wearable!
If you have your wearable paired with your phone, these things will automatically update and there should be not be a problem.
I would not recommend hard coding your build.gradle to 5.0.77, because then you will never update to use the new APIs for Play Services.

Resources