Failed to execute aapt - build.gradle

Please help solving this error:
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)
at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:109)
at sun.reflect.GeneratedMethodAccessor540.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)

Add the plugin "cordova-android-support-gradle-release" in package.json.
It works perfectly fine.

For me, the case was bit different. I could build and debug unsigned APKs. Each time I tried to make a signed release with Jar signing, got this error. Restarting android studio didn't solve it.
This is how I solved it.
It happened that my complete address of the project had white spaces. D:\Google Drive\blah blah . . . .Changed it to GoogleDrive, reloaded the project and the issue was gone.

Add this line
android.enableAapt2=false
To your gradle.properties file
android.useDeprecatedNdk=true
android.enableAapt2=false
MYAPP_RELEASE_STORE_FILE=xxxxxxx
MYAPP_RELEASE_KEY_ALIAS=xxxxx
MYAPP_RELEASE_STORE_PASSWORD=xxxxxxxx
MYAPP_RELEASE_KEY_PASSWORD=xxxxxxxxx

I was getting same error, but cordova plugin add cordova-android-support-gradle-release worked for me. Worth to give it a try if it is not installed.

Related

Xamarin android in rider IDE problem com.android.tools.idea.layoutlib.RenderingException

when in tried to edit a layout design in activity_main.axml this error won't let me to use palette or to show how layout looks like. enter image description here
this is the error when I click the details:
com.android.tools.idea.layoutlib.RenderingException: "C:\Users\Rachid\AppData\Local\Android\Sdk\platforms\android-30\data\fonts" directory cannot be found
at com.android.tools.idea.layoutlib.LayoutLibraryLoader.loadImpl(LayoutLibraryLoader.java:55)
at com.android.tools.idea.layoutlib.LayoutLibraryLoader.load(LayoutLibraryLoader.java:108)
at org.jetbrains.android.sdk.AndroidTargetData.getLayoutLibrary(AndroidTargetData.java:179)
at org.jetbrains.android.sdk.AndroidTargetData.getLayoutLibrary(AndroidTargetData.java:171)
at com.android.tools.idea.rendering.RenderService$RenderTaskBuilder.lambda$build$1(RenderService.java:551)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)
I encountered the same issue as you from a fresh install of all my development environment. I have just tried with the new 2021.1.2 update and it seems the issue is now fixed.

What is the cause of FluentValidation Method Not Found exception?

I've got a Domain Driven Design solution and for some reason, I'm getting this exception at RunTime when the API call is made through GateWay:
One or more errors occurred. (Method not found: 'Void FluentValidation.AbstractValidator`1.When(System.Func`2<!0,Boolean>, System.Action)'.)
The error occurs as below:
I have solution like this:
The main 4 project I'm focusing on right now are:
Core.Model
Account.Api
Service.Api.Gateway
Web.ClientSite
Web.ClientSite makes request to Service.Api.Gateway which then calls Account.Api.
Note that Core.Model is referenced everywhere
VERY IMPORTANT: If I remove the reference of FluentValidation from Core.Model, the exception disappears.
I'm hoping these information is enough. Why do you think I'm getting this exception and how can I eliminate.
Looks like some of libs (ocelot) are incompatible with new changes in FluentValidation 8.1.2. Try to downgrade to FluentValidation before 8.1.2. Hope it helps
I got similar exception:
System.MissingMethodException : Method not found:
'FluentValidation.AssemblyScanner
FluentValidation.AssemblyScanner.FindValidatorsInAssembly(System.Reflection.Assembly)'
In my case I needed to upgrade the ediatR.Extensions.Microsoft.DependencyInjection and MediatR.Extensions.FluentValidation.AspNetCore packages as well to fix the issue.

Liferay upload file bug

Is there any quick fix for liferay, to fix upload file bug.During upload I have :
ERROR [BufferedIncreament-DLFolderLocalService.updateLastPostDate(long,Date)-1][BufferedIncrementRunnable:68] Unable to write buffered increment value to the database
java.lang.NullPointerException
at java.util.Date.getMillisOf(Date.java:956)
at java.util.Date.before(Date.java:915)
at com.liferay.portlet.documentlibrary.service.impl.DLFolderLocalServiceImpl.updateLastPostDate(DLFolderLocalServiceImpl.java:1095)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
at com.liferay.portal.increment.BufferedIncreasableEntry.proceed(BufferedIncreasableEntry.java:48)
at com.liferay.portal.increment.BufferedIncrementRunnable.run(BufferedIncrementRunnable.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
The only solution I know is reset of DB schema - which could be problematic :( Help!
You should report the issue at issues.liferay.com (unless you find that one already exists) and do either of:
Wait until it is fixed.
Create an ext plugin and add a check to DLFolderLocalServiceImpl.updateLastPostDate:
if (dlFolder.getLastPostDate() != null
&& lastPostDate.before(dlFolder.getLastPostDate())) {
return;
}
Don't use document folders (just put everything into the root)
Temporarily fix this for all existing folders by updating the lastPostDate for all document folders in the database while your server is offline (or flush the cache afterwards):
UPDATE DLFOLDER SET LASTPOSTDATE = NOW() WHERE LASTPOSTDATE IS NULL
Liferay runs quite a bit of code to make sure that service builder has its context - if your stacktrace isn't shortened, it looks like you're running in a request-independent thread, which might not have servicebuilder initialized correctly (obviously).
Thus it might be that it isn't a bug in Liferay, but you'd need to prepare the environment the same way that Liferay prepares it. I can't exactly point you to the necessary steps, but you might keep that in mind. Also, nothing in the stacktrace points to an "upload bug" IMHO, as you're only touching the last post date
If you omitted parts of the stacktrace, it'd be good to signal that with "..." where you leave out stuff. It doesn't look complete to me. The parts you posted don't really look proper to me.

flashdevelop error while loading initial content

I have been struggling with this stupid error from couple of hours. Have tried everything but it still persists. I'm unable to run any Flash Mobile AS3 project in FlashDevelop.
This is what it says in Output panel:
Debugger startup error. For troubleshooting see: http://www.flashdevelop.org/wikidocs/index.php?title=F.A.Q
Error details: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at net.sf.jni4net.jni.JNI.Dll.JNI_GetDefaultJavaVMInitArgs(JavaVMInitArgs* args)
at net.sf.jni4net.jni.JNI.Init()
at net.sf.jni4net.jni.JNI.CreateJavaVM(JavaVM& jvm, JNIEnv& env, Boolean attachIfExists, String[] options)
at net.sf.jni4net.Bridge.CreateJVM()
at net.sf.jni4net.Bridge.CreateJVM(BridgeSetup setup)
at FlashDebugger.DebuggerManager.Start(Boolean alwaysStart)
[Capturing traces with FDB]
and this is what it shows in the console/command prompt:
error while loading initial content
Please if anyone had seen this error and solved it successfully, I would really appreciate any help. Screenshot attached below.
Thanks!
Looks like you are using wrong Java SDK version 64 bit rather than 32 bit which FlashDevelop requires

GWT-Tutorial StockWatcher, not using new HTML-File

I am currently working through the StockWatcher-Tutorial on the GWT page and come this far to Step 3: Build the User Interface.
I changed the content of the hosted HTML-page as said and done the rest of the tutorial.
But when I try to test the new page and start Run > Debug As > Web Application, I get an exception in onLoad():
onModuleLoad() threw an exception Exception while loading module
com.ma.project.client.MaWebAppProject. See Development Mode for
details.
java.lang.reflect.InvocationTargetException at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source) Caused by:
java.lang.NullPointerException at
com.ma.project.client.MaWebAppProject.onModuleLoad(MaWebAppProject.java:41)
... 9 more
and the Development Mode Tab in Eclipse says:
[ERROR] [mawebappproject] - Unable to load module entry point class
com.ma.project.client.MaWebAppProject (see associated exception for
details)
I have found out so far, it seems the changes I made in the HTML-file are not recognized by the development server although I saved the file and everything. I tried to use the GWT Compile Project but no effect.
Seems the Java Code is crashing because it can not find the , which is used as the RootPanel.
Does anyone have an idea?
UPDATE: After some trail and error I found out I had to refresh the page once in the browser after the error message. The it worked. I still don't know why this happened, but so far it not happened again...
could it be that you have replaced the whole html file with the one from the page. this can cause a problem, because on the page, it uses your project name which is certainly not stockwatcher but apparently something like this: com.ma.project.client.MaWebAppProject (guessed).
I suggest you only you restore the last running state and replace only the lines which are marked yellow, then it should work.
The other reason could be that you didn't use RootPanel.get("stockList") or gave another name to the id div (this one: <div id="stockList"></div>). These two names must be identical (and the id field unique of course), because the RootPanel get method searches for a field with that id and places the Widget inside of it. (btw: RootPanel.get() with no parameters, it uses the body element so you can also try this).
Well this are all possibilities right now^^
I think I had this exact issue. My problem ended up being that the word "stocklist" was lower case in the html id like so:
<div id="stocklist"></div>
but was camel cased in the java code where the stocklist is associated with the main panel:
RootPanel.get("stockList").add(mainPanel);
The solution was, of course, to make one match the other.