Android Studio - warn: removing resource not found - android-studio

All of a sudden I'm receiving Android Studio errors when I try to build my app. It happend today in the morning when I started up my laptop, while yesterday it didn't. Android Studio says that I'm missing a string resource and 2 drawables which are nowhere to be found in my project nor used.
The error:
Output: warn: removing resource nl.coffeeit.inlite:string/status_bar_notification_info_overflow without required default value.
C:\Users\Maffia\AndroidStudioProjects\In-Lite\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v21\values-v21.xml:301: error: resource drawable/notification_action_background (aka nl.coffeeit.inlite:drawable/notification_action_background) not found.
C:\Users\Maffia\AndroidStudioProjects\In-Lite\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v21\values-v21.xml:306: error: resource dimen/notification_action_text_size (aka nl.coffeeit.inlite:dimen/notification_action_text_size) not found.
error: failed linking references.
Command: C:\Users\Maffia\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\6c2b371e8419c4016ded3efc6f9ea641\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\Maffia\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
--manifest\
C:\Users\Maffia\AndroidStudioProjects\In-Lite\android\app\build\intermediates\split-apk\debug\resources\AndroidManifest.xml\
-o\
C:\Users\Maffia\AndroidStudioProjects\In-Lite\android\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
#C:\Users\Maffia\AndroidStudioProjects\In-Lite\android\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
C:\Users\Maffia\AndroidStudioProjects\In-Lite\android\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
nl.coffeeit.inlite\
-0\
apk\
--preferred-density\
440dpi\
--output-text-symbols\
C:\Users\Maffia\AndroidStudioProjects\In-Lite\android\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
I have no idea where those resources come from. I've tried multiple things to solve this issue:
clean project
rebuild project
clear build directory
invalidate caches/restart
reviewed all my layout and string resources for errors
restart my laptop
even tried to revert to previous git commits, didn't work
tried adding the specified string resource, still the two drawables
popup as error
re-created git project twice
Does anyone know what could be wrong? I don't see it.

I resolved this issue by doing the following:
copy the Android Studio project to a different location
remove C:/Users/username/.gradle/caches
re-open the copied project in step 1
Everything is working again. Although I still don't understand what the problem was.

Do you remember any last Library you introduced in your app or try to remember some last code edits you did, it would help to resolve this issue.
If it doesn't work delete this folder.
C:\Users\Maffia\.androidstudio
This folder contains caches only and its name is appended along with android studio version.

Related

Can not publish Blazor wasm to azure anymore

i just wanted to publish my changes to my .Net6 blazor wasm app to azure to update it like i did a dozen times. Since yesterday that does not work anymore. I can build and run it locally with no problem but when I try to publish it, I get a window telling me:
Publish has encountered an error. Build failed. Check the Output
window for more details.
A diagnostic log has been written to the following location:
"C:\Users\user\AppData\Local\Temp\tmpE865.tmp"
Content of that file:
16.06.2022 08:20:08 System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException:
Build failed. Check the Output window for more details. --- End of
inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.
Check the Output window for more details.<---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.
Check the Output window for more details.
===================
Console Output:
C:\Program Files\dotnet\sdk\6.0.400-preview.22301.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(614,5): Error MSB6006: "dotnet.exe" exited with code 1.
Tried fetching older versions of the code that I successfully published a few days ago. Still does not work. My coworker can still publish the same code.
But I can publish my API Backend...so this error seems to be related to blazor wasm.
Tried this with the latest release of VS 2022 and just gave the preview version a try - no luck.
I've also done a repair installation of the .Net 6 SDK.
Edit: I've tried to publish my project to a folder and got the same error. So no relation to azure. Then I've created a new blank Blazor app...I can publish this one to a folder with no error. So my project is somehow broken...but even older code can't be published. This is so odd...
Same issue for me. Publish stopped working after the latest VS update.
Removing blanks in path resolved it
#XSharp is correct.
We had same issue started occurring yesterday.
We were using version '6.0.x' of DotNet which seems to have started using version '6.0.301' that seems to be causing this issue. Force it to use the previous version '6.0.106' instead
Just add the following at the top of your tasks in your YAML
- task: UseDotNet#2
inputs:
packageType: 'sdk'
version: '6.0.106'
Looks like someone has reported it as an issue when having a blank space in your project path: https://github.com/dotnet/core/issues/7548
I kept getting error "Microsoft.NET.Sdk.Blazor WebAssembly.6_0.targets(614,5): error MSB6006".
I can confirm once I removed spaces (my directory to mydirectory) on the build environment, the blazor build was successful.
In my case, changing the SDK in the YAML of the pipeline fixed the issue for us.
In UseDotNet#2 task:
Changed : version: '6.0.x'
To : version: '6.0.106'
It was working before so it seems like something has changed in the hosts.
I've had this problem off-and-on for more than a year. Sometimes it seems to be caused by a Visual Studio update and sometimes a dependency (nuget) update, but sometimes it seems spontaneous; I can't seem to figure out the real cause. This time I tried removing spaces from the path, but that did not work.
I got it to publish again after (1) removing spaces from the path, (2) deleting the publish profiles, (3) deleting the hidden ".vs" folder from the solution directory, (4) running "Clean Solution" in VS, (5) deleting all "bin" and "obj" folders from the solution tree, (6) re-importing the publish profile, building, and publishing. I wish I knew which of those really affected the problem, or better yet, I wish MS would fix this bug.

Android Studio 3.6.3 How to get rid of ERROR: Unable to resolve dependency for ':app#debug/compileClasspath' (androidx.fragment:fragment)

I'm tired of getting this error every third/fourth time I try to build project:
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve androidx.fragment:fragment:[1.2.0].
Show Details
Affected Modules: app
It also effects ':app#debugUnitTest/compileClasspath' and ':app#debugAndroidTest/compileClasspath' (shows the same error for them).
Also sometimes it goes after the following build error (internet connection is surely stable):
Unknown host 'repo.maven.apache.org: nodename nor servname provided, or not known'. You may need to adjust the proxy settings in Gradle.
Enable Gradle 'offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
There were no changes in build.gradle files or any other gradle files before this error came.
It would be nice if you help to get rid of it. Gradle-plugin version = "1.3.71".

Android Studio cant find or install play-services 7 /wearable

I have a new windows 8.1 machine, and am trying to get my android IDE environment installed. But there seems to be some issues that i have never encountered before. my existing projects are not compiling because the system can not find or even download the proper play services libs..
Error:A problem occurred configuring project ':mobile'.
Could not resolve all dependencies for configuration ':mobile:_debugCompile'.
A problem occurred configuring project ':wear'.
Could not resolve all dependencies for configuration ':wear:_debugCompile'.
Could not find com.google.android.gms:play-services-wearable:7.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.jar
file:/C:/Users/Erik/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.pom
file:/C:/Users/Erik/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.jar
file:/C:/Users/Erik/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.pom
file:/C:/Users/Erik/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.jar
Required by:
AndroidClickDogTrainer:wear:unspecified
So i tried using the SDK manager to insure i had the proper play services but
I keep getting the following error from my SDK manager in Android Studio on my Windows 8.1 machine.
This is a clean install, and i thought it may be my firewall settings but after turning off my firewall completely it is still happening:
Refresh Sources: Fetched Add-ons List successfully Refresh Sources
Failed to fetch URL
https://dl.google.com/android/repository/addon.xml, reason: File not
found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml,
reason: File not found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml,
reason: File not found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml/addon.xml,
reason: File not found Refresh Sources: Failed to fetch URL
https://dl.google.com/android/repository/addon.xml, reason: File not
found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml,
reason: File not found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml,
reason: File not found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml/addon.xml,
reason: File not found Ignoring unknown package filter
'extra-google-m2repository'Warning: The package filter removed all
packages. There is nothing to install.
Please consider trying to update again without a package filter.
No matter what i do.. TURN OFF FIRE WALL, RUN AS ADMIN.. etc etc.. it just won't install the play services libs..
please help
So I searched high and low for an answer to this, and it seems a lot of people are having this and similar issues and creating really cumbersome workarounds that include everything from re-writing parts of the android.bat file to uninstalling the SDK and re-installing it from scratch.. for me none of those solutions worked.. but what seems to have fixed the problem was actually quite simple.
hope this helps others..
open the Android SDK Manager.. click on TOOLS>Options and check "Force https://.. sources to be fetched using http://.."

A library uses the same package as this project

For 2 days, I have been trying to fix my Android Studio setup, but despite a lot of googling have had no luck fixing this problem. Gradle keeps giving me the error
Error:Execution failed for task ':Android-Tabbedout-30:processQaReleaseResources'.
Error: A library uses the same package as this project
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
If I add in the enforceUniquePackageName=false to the gradle file, then the project can be successively refreshed by Gradle, but once I try to run it I get this error:
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define
Any ideas on how to fix this?
I was searching for that same problem and i find this on github
https://github.com/DWorkS/AStickyHeader/issues/12
And this solved my problem.
All this says is to rename the package name on the AndroidManifast.xml file.
And its done.

When building blackberry10 cordova/phonegap project many files are missing

When building a blackberry10 cordova/phonegap project, a number of files are not included in the build. A number of splash screen images and the file "DEFAULT_BAR_NAME.bar" are not included.
However, if the same process is repeated on another device (desktop PC) all files are included. As far as I can tell, both have identical software setups.
C:\Users\USER\hello>cordova emulate blackberry10
[Error: An error occurred while emulating/deploying the blackberry10 project.
[BUILD] Populating application source
[BUILD] Parsing config.xml
[BUILD] Generating output files
[WARN] Failed to find debug token. If you have an existing debug token, please copy it to %HOME%/.cordova/blackberry10debugtoken.bar. To generate a new debug token, execute the 'run' command.
[ERROR] Error: Attribute image: file cannot be found in the list of packaged files: res/screen/blackberry/splash-1280x768.png
[ERROR] Native Packager exception occurred
[WARN] Failed to find debug token. If you have an existing debug token, please copy it to %HOME%/.cordova/blackberry10debugtoken.bar. To generate a new debug token, execute the 'run' command.
[ERROR] Error: Attribute image: file cannot be found in the list of packaged files: res/screen/blackberry/splash-1280x768.png
[ERROR] Native Packager exception occurred
[ERROR] Error: File does not exist or not a file or cannot read: C:\Users\USER\hello\PLATFO~1\BLACKB~1\build\simulator\DEFAULT_BAR_NAME.bar
If any more information will help then please ask, thanks!
I saw this message a bit late.
But I have a solution for this problem.
Browse to the root of your phonegap project (the one containing these folders merges,platforms,www & plugins)
Open the www folder
Open config.xml
Now carefully remove all the declarations for splash and icon for those platforms those are not added using cordova platform add command. For e.g if you have created a project only for blackberry remove all the icon and splash declarations for ios, android, webos, bada, windows-phone
Now run cordova build. Your blackberry app should be built without any errors.
I was able to compile my blackberry 10 app in phonegap 3.3
If you face any errors regarding p12 file then you need to follow the blackberry signing guidelines. Or if you got any doubts then mail me
hansolo.amey#gmail.com

Resources