aapt2 Removing resource * without required default value - xamarin.android

When building a Xamarin.Android project it is written in the output window that aapt2 has removed resources due to a missing default value.
Xamarin.Android.Aapt2.targets(160,3): warning APT2000: warn: removing resource com.companyname.demo_app:drawable/parking_slot without required default value.
The removed resource is part of a Xamarin.Android binding project and is also included in the aar-file under drawables and in the R.txt.
Because it is only a log-statement in the build output, the project builds and the app can be started. But when using one part of the binding-project the following error will be thrown:
Java.Lang.NoSuchFieldError: 'No static field parking_slot of type l in class Lcom/company/sample/R$drawable; or its superclasses (declaration of 'com.company.sample.R$drawable' appears in /data/app/com.companyname.demo_app-Ab0cDefG==/base.apk)'
What does cause the removal of the resource and how can it be prevented?
Edit 1:
The missing resource parking_slot is not in the drawable folder but in drawable-xhdpi-v4 for example. To check this I renamed the aar to zip and extracted it.
I then copied parking_slot it to the drawable folder, zipped and renamed it to aar again. Building is now without the aapt2 warning. Yet the app crashes again with:
Java.Lang.NoClassDefFoundError: 'Failed resolution of: Lcom/company/sample/R$drawable;'

I tested the aar-file with a native non-Xamarin app and no issue came to my attention which brings me to the conclusion that something might be broken with the way the Xamarin app is build.
Nevertheless the fix (or the workaround if you want) looks like this:
Rename aar to zip and unzip.
Search for the missing resource. In my case parking_slot
Copy the missing resource into your app-project
I think this works because of the way Androids fallback-system works.

Related

Build failed - Check imports - Dart Angular Tutorial - angular_tour_of_heroes - part 2

While following tutorail - Angular-dart tutorial - Tour of Heroes - part 2
with using IntelliJ IDEA in Windows 10 while using chrome, I got following error(s) -
[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached):
Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
Please check the following imports:
import 'package:angular_app/app_component.css.shim.dart' as import0; from angular_app|lib/app_component.template.dart at 12:1
[SEVERE] Failed after 1.3s
Serving web on http://localhost:53323
I have checked multiple times & I have replaced all - 5 files - namely
lib/app_component.css, lib/app_component.dart, lib/app_component.html, lib/src/hero.dart & lib/src/mock_heroes.dart from Review the app structure but I am still getting the above mentioned error & -
I could not find any app_component.template.dart
Nor could found any instance of imported package:angular_app/app_component.css.shim.dart or shim using IntelliJ Find in Path (Ctrl+Shift+F)
I have tried to delete build and rebuild.
I have also re-installed dart 2.1.0 using windows package manager & changed the location of dart-sdk accordingly in IntelliJ IDEA Settings/Dart, as for brief period I was getting dart-sdk error, but that is fixed.
This my first time asking question on stacksoverflow, but I have checked similar questions, could not resolve that issue.
the most likely reason for that build failure is due to the stylesUrls files not being found. This could be because the name in that array doesn't match the name in the file system or is not the expected place in the file system.
To confirm, I started from scratch, downloaded the quickstart-master.zip to get the project structure.
And followed the steps all the way through the step you were stuck on.
The only time I was able to generate that error while following the steps is when I added thestyleUrls: ['app_component.css'], to app_component.dart prior to creating the file.
I got the same:
[SEVERE] build_web_compilers|entrypoint on test/app_test.dart.browser_test.dart:
Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
Please check the following imports:
import 'package:angular_app/app_components.css.shim.dart' as import0; from angular_app|lib/app_component.template.dart at 12:1
Once i created the css file, the error went away and everything worked fine.
I completed the entire step you were up to and my app was working fine.
I then did as you did and copied each file from the step and replaced my work with it, still worked.
So confirm my hunch, i changed the name of the css file, and received the same error.
regarding app_component.template.dart that file is auto generated by dart and can be found in your project under .dart_tool/build/generated/angular_app/lib
I had a very similar problem. I ran webdev build and then webdev serve and it fixed it right up.

Qt XCode iOS entry point

I am trying to port QT5 application to iOS. It builds and runs fine with QtCreator, but now I am trying to make manual XCode project. Next steps are gatheres from another topics, here is my final path:
It builds and runs, but I got runtime error:
Error: You are creating QApplication before calling UIApplicationMain.
I've found, that I should replace main -> qtmn, but then I got error about no entry point.
The declaration of main is inside of libqios.a, but I am unable to tell linker "Take main() from libqios, not from cpp files."
I tried it with
-Wl,-force_load,$(QT_SDK)/plugins/platforms/libqios.a - but it does nothing.
I found, that QT preprocessor makes something with object files (renaming main into something others), but it looks too horrible. How can it be solved?
Succeeded in by: renaming main -> qtmn (in qt sourced), rebuilt QT, and called qt_main_wrapper from my main().

CRITTERCISM_DIR_NAME: No such file or directory

I am using crittercism crash reporting tool . Initially it is working fine , but now it showing error
CRITTERCISM_DIR_NAME: No such file or directory
This error suggests that the path of the crittercism library placed on your system is not specified. We usually encounter this message while uploading dSYM using the build script. By following this method, we are supposed to mention the APP ID, APP Key and Source path of the script which might be missed here and caused the error. You may refer to the following article for detailed information :
https://docs.apteligent.com/ios/ios_dsym.html#configuring-crash-symbolication

Xcode/Cocos2d-x "Could not inspect application package" error randomly alternates with "${EXECUTABLE_NAME} does not exist"

I'm trying to run my Cocos2d-x app built in Xcode 5.0.2 on a 4th generation iPod Touch running iOS 6.1.5. I don't have any third party libraries in the project yet, other than Cococs2d-x.
When I hit run, the behavior is inconsistent. Xcode builds the whole project without a hitch, but then gives me one of two errors at random. It doesn't strictly alternate, and it isn't tied to whether it's a clean build. It's just a coin toss.
Sometimes, I get not one, but two Could not inspect the application package. errors.
Sometimes, on the other hand, Xcode gives me this error:
The Info.plist for application at /Users/me/Library/Developer/Xcode/DerivedData/myapp/Build/Products/Debug-iphoneos/myapp.app specifies a CFBundleExecutable of ${EXECUTABLE_NAME}, which does not exist
I've found several reports of similar errors around the internet, but they usually say it specifies an executable of "(null)", and their solutions don't work for me. The most popular solution is, frustratingly, to set CFBundleExecutable (AKA "Executable File") to ${EXECUTABLE_NAME} in my Info.plist, which it is.
Any ideas? This is really weird.
UPDATE: Okay, I set Executable File to my literal product name, and now I'm down to the two "Could not inspect the application package." errors. The other error no longer comes up. That's some progress, anyway...
You could try using:
CFBundleExecutable ${PRODUCT_NAME}
in your info.plist
Sometimes deleting the ${EXECUTABLE_NAME} and manually putting it in works also. It sounds as if there's some corruption going on with the build and it's ignoring the parameter.

How can I fix this delphi 7 compile error - "Duplicate resource(s)"

I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting this error:
[Error] WARNING. Duplicate resource(s):
[Error] Type 2 (BITMAP), ID EDIT:
[Error] File C:[path shortened]\common\CRGrid.res resource kept; file c:\common\raptree.RES resource discarded.
It says warning, but it's actually an error - compilation does not complete.
It looks like two components - CRGrid and RapTree - are colliding somehow. Does anyone have any ideas on how to fix this?
Other than removing one of components from the project, of course.
Try firing up your resource editor (I'm pretty sure Delphi comes with one) and open the files. Check what bitmap resources are in the two, see which can be the duplicate.
If you need to keep both resources, you need to renumber one of them.
try this: Fixing the "Duplicate resource" error
You'll need to go into the components and rename one of the resources and then update the component code to use the new name. It's a pain, but that's all you can do.
I know this is an old thread, but still worth an update for anyone maintaining old code:
I had this problem and it was due to images in RES files being named the same thing. Delphi7 has an Image Editor which can open RES files. Simply open both RES files involved in the Duplicate Resource error, and rename one of the offending duplicate resources. Save the RES files and recompile. Has worked for me twice recently when I replaced an old component in a Delphi 7 app with a (slightly) newer one.

Resources