My project contains activity declarations in the manifest that use the tools:targetApi attribute to ignore some warnings. Specifically:
<activity
android:name=".activities.ProtocolActivity"
android:label="#string/title_activity_protocols"
android:parentActivityName=".activities.InformationActivity"
tools:targetApi="jelly_bean">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.InformationActivity" />
</activity>
Out of the blue, however, for instance after switching branches, I get the following compilation error:
Error:/home/paul/git/ally-v2-app/app/src/main/AndroidManifest.xml:67:9-80:20:
Error: Invalid instruction 'targetApi', valid instructions are :
REMOVE,REPLACE,STRICT
...
Error:java.lang.IllegalArgumentException: No
enum constant com.android.manifmerger.AttributeOperationType.TARGETAPI
I'm using the following:
Gradle 2.10
Gradle plugin 2.0.0-beta6
Android Studio 2.0 beta 6
Both on an Ubuntu 15.10 machine and a Windows 10 machine
It seems I can get things working again by clearing the cache and restarting Android Studio, or removing the attributes, building, then adding them again.
Replacing it by
tools:ignore="UnusedAttribute"
also fixes the lint issue.
Remove the targetApi tag:
tools:targetApi="jelly_bean"
I am posting this late, but probably will help someone..
Find the manifest.xml file described by error in the temp folder, copy it and past in the assets->plugins->android directory and rename it to AndroidManifest.xml
Then edit it and find the <application...> and inside it paste the suggested solution.
For example, I had to paste tools:replace="android:label" so it would look like <application ... tools:replace="android:label">
Related
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.
Today the phonegap build issue an error with launchnavigator plugin,the following error is displayed on the build log:
Failed to install 'uk.co.workingedge.phonegap.plugin.launchnavigator': Error: Variable(s) missing: GOOGLE_API_KEY_FOR_ANDROID, any thought?
Worth to try this command line to include in your project as well
$ cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable GOOGLE_API_KEY_FOR_ANDROID="{your_api_key}"
According to the plugin's CHANGELOG, there's a new major version 5.0.0 which contains this change:
Add plugin variable to enable specification of Google API key for geocoding on Android. Fixes #211.
So you will need to add the plugin variable as outlined in the updated plugin documentation:
<plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" source="npm" >
<variable name="GOOGLE_API_KEY_FOR_ANDROID" value="{your_api_key}" />
</plugin>
I just did an npm update on my Aurelia CLI project, and now I'm suddenly getting Toast notifications from Gulp for TypeScript compilation errors in Visual Studio 2015, which is really, really annoying.
Can anyone provide guidance on how to switch this off? Also, does anyone know of any recent changes to Node packages that would cause this behaviour to start happening?
The compilation is disabled by opening the .csproj file for the project and add the following line, right after the TypeScriptToolsVersion element:
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
UPDATE:
In RC2, you can disable it by adding TypeScriptCompileBlocked to the .xproj file.
<PropertyGroup>
<TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
</PropertyGroup>
To remove this you would want to modify your transpile.js file to remove gulp notify - you would do this here:
https://github.com/aurelia/cli/blob/3c5ea5f935e523d1cec5ead884391d6b008deee5/lib/resources/tasks/transpile.js#L22
If someone is coming later to look for the same thing from a skeleton it is here in build/tasks/build.js -
https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-typescript/build/tasks/build.js#L26
I remove this on my TypeScript problems because it emits too many issues when refactoring code.
Some time my project in MyEclipse show me the following error on compilation. Sometime by restarting MyEclipse the error message disappear.
Can you please tell me why this error occurs ?
Error message :
The container 'Struts 1.1 Libraries' references non existing library 'C:\MyEclipse\.......\org.eclipse.osgi\bundles\16\1\.cp\data\1.1\lib\commons-beanutils.jar' ROMO_ETD Build path Build Path Problem
Thanks a lot.
Looks like you might be using an old unsupported release of MyEclipse, so one option would be to upgrade to the latest release. Another would be to run MyEclipse with the -clean argument, once. The argument is mentioned here (for the eclipse Juno release, but it's similar for earlier releases): http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm?cp=0_3_0
Basically, the argument is added to the command line or to the top of the myeclipse.ini file, in the folder containing the myeclipse.exe file. The argument can be removed after the first launch, as it slows down the launch.
After updating to the latest versions of Xamarin Studio this morning the ZBar and ATMHud references in our project started throwing a bunch of errors, all of which were:
The type 'MonoTouch.UIKit.UIViewController' is defined in an assembly that is not referenced. Consider adding a reference to assembly 'monotouch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' (CS0012)'
I did some reading and found out that I needed to rebuild both of the libraries because of something to do with "assembly strong names" in Xamarin. I was able to muddle my way through rebuilding the ZBar library, but the ATMHud rebuild has given me some trouble and I'm not familiar enough with what I'm doing to fix the problem.
I downloaded the ATMHud project from github and followed the instructions in the readme which state "Run 'make' in the binding directory to build ATMHud.dll", but when I do that I get errors.
Teds-Mac:binding ted$ make
/Developer/MonoTouch/usr/bin/btouch -e atmhud.cs enums.cs AssemblyInfo.cs --out=ATMHud.dll --link-with=libATMHudSDK.a,libATMHudSDK.a
/var/folders/75/vl_6zkyx03sc4tymnp41lsgw0000gn/T/09x9yx7m.nz9/AtmHud/AtmHud.g.cs(751,86): error CS0103: The name class_ptr' does not exist in the current context
/var/folders/75/vl_6zkyx03sc4tymnp41lsgw0000gn/T/09x9yx7m.nz9/AtmHud/AtmSoundFX.g.cs(75,104): error CS0103: The nameclass_ptr' does not exist in the current context
Compilation failed: 2 error(s), 0 warnings
btouch: API binding contains errors.
make: * [ATMHud.dll] Error 1
I've scanned through the files in the folders but can't seem to track down any references to "class_ptr".
Can anyone help with what might be the cause of the problem I'm seeing, and can you confirm that this will get me past the original "assembly strong names" problem I'm seeing?
As a temporary measure you can fix your old assemblies with this tool: https://github.com/rolfbjarne/iOSRefUpdater
Update
I've fixed the ATMHud bindings, now they should compile with newer versions of Xamarin.iOS installed as well.