XWalkView doesn't load downloaded files / local files and returns Assertion Error - crosswalk

I am using this to implement crosswalk webview to my app
implementation 'org.xwalk:xwalk_core_library:23.53.589.4'
And I am setting up the XWalkView like this
private XWalkView xWalkWebView;
....
xWalkWebView=(XWalkView)findViewById(R.id.xwalkWebView);
and when I load an external HTML file like this, it loads fine
xWalkWebView.load("website.com/htmlfile.html",(String) null);
BUT when I try loading a local file it returns an error
xWalkWebView.load("file:///" + Environment.getExternalStorageDirectory().getAbsolutePath() + "/Download/File.html",(String) null);
The CrossWalk Activity crashes with a AssertionError warning and in some cases a NullPointerException
I have tried using XWalkView cache to store the data in its instance
xWalkWebView.clearCache(true);
xWalkWebView.getSettings().setCacheMode(XWalkSettings.LOAD_CACHE_ELSE_NETWORK);
xWalkWebView.reload(2);
It didn't work, and I also tried loadUrl, loadData, and loadDataWithBaseURL all of those didn't work trying to load a local file
I have tried a bunch of stuff like separating the function creating the XWalkView to a separate class to avoid the NullPointerException and a lot of other things but nothing worked and I am wondering if there is another function to load local files using XWalkView
Any help would be appreciated, thanks!
Edit: The Warning I am getting when the activity crashes is:
W/System.err: java.lang.AssertionError
at org.xwalk.core.internal.AndroidProtocolHandler.getAssetPath(AndroidProtocolHandler.java:82)
at org.xwalk.core.internal.XWalkMediaPlayerResourceLoadingFilter.shouldOverrideResourceLoading(XWalkMediaPlayerResourceLoadingFilter.java:38)
at org.chromium.media.MediaPlayerBridge.setDataSource(MediaPlayerBridge.java:205)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)

I had the same problem. It was solved by modifying the Gradle version.
I think the highest Gradle version (currently 4.1.2) is not compatible with XWalkView. When I changed the Gradle version to 4.0.0, it works well.

Related

AEM6.2: com.day.cq.wcm.tags.IncludeTag Error

We have AEM6.2 node environment and we are trying to access login.html but getting error as below.
After searching I came to know that java version could be one of the possible reason but I am already using Java 8 for this application. I am out of ideas. Any suggestions greatly appreciated.
14.09.2018 14:08:40.299 *ERROR* [192.156.110.11 [1536948520114] GET /content/en/account/login.html HTTP/1.1] com.day.cq.wcm.tags.IncludeTag Error while executing script defaulttopnav
org.apache.sling.api.scripting.ScriptEvaluationException:
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:416)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:178)
at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:95)
at org.apache.jsp.apps.components.navigation.topnavigation_jsp._jspService(navigation_jsp.java:329)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.sling.api.SlingException:
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInternal(JspServletWrapper.java:691)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:608)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:533)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:284)
at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:102)
at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:536)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
... 201 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.apache.jsp.apps.components.topnavigation.defaulttopnav_jsp._jspService(defaulttopnav_jsp.java:347)
at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
... 206 common frames omitted
Thank you.
General solution for errors are thrown by servlets compiled from jsp files, is to recompile the jsp again.
Goto system/console and verify if all bundles are in active state
Goto sling --> jsp and recompile all jsps.
This works if errors are thrown from otb jsp. However when custom application jsps throw error, you ll need to fix the custom jsp code by handling the error.
Another foolproof way to clear cached jsp class files is to delete /var/classes
The stacktrace indicates the NPE is stemming from defaulttopnav_jsp.java, line 347. Analysing the generated java file is the way to go.
Since AEM 6.1, the default ClassLoader was replaced by FSClassLoader and the generated .java files are no longer stored under /var/classes.
To locate the .java file you will need to locate the bundle ID for the FSClassLoader bundle, then the java files will be located at:
[AEM_INSTALL_DIR]/crx-quickstart/launchpad/felix/bundle[BUNDLE_ID]/data/classes
There is also a sling plugin which will help you view the generated java file from OSGi console. Check out these posts for that.

Google.JarResolver.ResolutionException: Cannot resolve com.google.firebase:firebase-analytics-unity:1.0.0()

In my Unity project, I used some assets like FacebookSDK, OneSignal etc. Whenever I import OneSignal, this error will be shown.
Google.JarResolver.ResolutionException: Cannot resolve com.google.firebase:firebase-analytics-unity:1.0.0()
I had tried many things, these are what I remember:
Using 'Play Service Resolver' does not solve the problem.
Importing Unity Firebase.
When I import Firebase, the error turn into another error, which is building error called CommandInvokationFailure, related to Firebase.
I spent several days to fix it, but still I couldn't. If you need further information, tell me please.
EDIT: #nika Thanks for reply. I tried every combination of API 23-24-25 and build tools from 23 to 25. But, I can't fix 'CommandInvokationFailure' yet. I think sharing the full log of the error will be better:
CommandInvokationFailure: Unable to convert classes into dex format.
/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/emre/Desktop/AndroidSDK/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzah;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzcn;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/BuildConfig;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoJellyBeanMr2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/animation/AnimatorCompatHelper;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at SDKMain.main(SDKMain.java:129)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
... 9 more
]
EDIT 2: #jkasten Thanks for reply. I can fix Android Support Library v4 Errors, however, for the second one is not easy because of resolvers.
There is no duplicated play-services files. This time, I improvised to solve it: removing play-services-ads-9.0.1 from android build by changing import settings(if other ads file is removed, the CommandInvokationFailure error continues.). I don't really know it is the right way to solve the problem, but it worked somehow. But it leads me another error when I tried to run game on my phone:
FATAL EXCEPTION: main
E/AndroidRuntime(18680): java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzaa; or its super classes (declaration of 'com.google.android.gms.common.internal.zzaa' appears in /data/app/***/base.apk)
E/AndroidRuntime(18680): at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
E/AndroidRuntime(18680): at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
E/AndroidRuntime(18680): at android.app.ActivityThread.installProvider(ActivityThread.java:5159)
E/AndroidRuntime(18680): at android.app.ActivityThread.installContentProviders(ActivityThread.java:4754)
E/AndroidRuntime(18680): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4694)
E/AndroidRuntime(18680): at android.app.ActivityThread.access$1600(ActivityThread.java:150)
E/AndroidRuntime(18680): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
E/AndroidRuntime(18680): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18680): at android.os.Looper.loop(Looper.java:148)
E/AndroidRuntime(18680): at android.app.ActivityThread.main(ActivityThread.java:5423)
E/AndroidRuntime(18680): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18680): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
E/AndroidRuntime(18680): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
From the following two unique lines in your log:
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzcn;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/BuildConfig;
This means there are 2 or more copies of the Google Play services library and the Android Support Library v4 in your project.
Fixing the Android Support Library v4 Errors (support/v4)
In order to use the OneSignal and Facebook SDKs together in the same Unity project you will need to delete the following duplicated libraries noted in the OneSignal troubleshooting guide.
FacebookSDK/plugins/android/libs/support-v4-23.4.0.aar
FacebookSDK/plugins/android/libs/support-annotations-23.4.0.aar
This will fix the already added: Landroid/support/v4 errors unless their is a 3rd plugin with this library as well in your project.
Fixing the Google Play services library Errors (gms)
I recommend deleting duplicate play-services-[library]-[version].aar files in your Unity project. There will be different [libraries] however there should only be a single version for all play-services-*.aar files. This should fix the already added: Lcom/google/android/gms errors.
If you get stuck update your question with a full list of plugins with version numbers. Also list all .aar and .jar files in your project. Additional you can create a new project and add one plugin at a time until you get the error to pin point the plugin combination creating the issue.
This question mentions a few different errors. All are eventually related to issues with native Android libraries (.jar or .aar) within the Unity project.
I'll try to address all of the issues you mentioned:
Cannot resolve (library name)
Google.JarResolver.ResolutionException: Cannot resolve
com.google.firebase:firebase-analytics-unity:1.0.0()
A lot of Android plugins use the Play Services Resolver - this is helper code that attempts to simplify things by automatically resolving the needed Google play services libraries (located under the Android SDK folder).
It works by setting the needed dependencies to a static instance of a class, which then attempts to resolve the needed libraries.
Sometimes, the operation of the resolver can fail, since it may become "out of sync" with its persisted data.
In this case, what probably happened is that the static object was still attempting to resolve the "firebase-analytics-unity" library, but this folder was removed from the project, so it failed to look it up.
Already Added Lxxx/xxx/xxx
Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/google/android/gms/internal/zzah; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Lcom/google/android/gms/internal/zzcn; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Landroid/support/v4/BuildConfig; Uncaught translation error:
java.lang.IllegalArgumentException: already added:
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Uncaught translation error: java.lang.IllegalArgumentException:
already added:
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;
Uncaught translation error: java.lang.IllegalArgumentException:
already added:
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoJellyBeanMr2;
Uncaught translation error: java.lang.IllegalArgumentException:
already added:
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
Uncaught translation error: java.lang.IllegalArgumentException:
already added:
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Uncaught translation error: java.lang.IllegalArgumentException:
already added: Landroid/support/v4/animation/AnimatorCompatHelper;
As was already answered by #jkasten, your project contains multiple plugins that contain the same compiled Java classes. The hint as to which library is duplicated can be found by the class names (not always helpful though). In this case, you can see that it's related to com.google.android.gms (google play services) and Android support library (android.support.v4.xxx).
No static method zzb
FATAL EXCEPTION: main E/AndroidRuntime(18680):
java.lang.NoSuchMethodError: No static method
zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class
Lcom/google/android/gms/common/internal/zzaa; or its super classes
(declaration of 'com.google.android.gms.common.internal.zzaa' appears
in /data/app/***/base.apk) E/AndroidRuntime(18680): at
com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
E/AndroidRuntime(18680): at
com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown
Source) E/AndroidRuntime(18680): at
android.app.ActivityThread.installProvider(ActivityThread.java:5159)
E/AndroidRuntime(18680): at
android.app.ActivityThread.installContentProviders(ActivityThread.java:4754)
E/AndroidRuntime(18680): at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4694)
E/AndroidRuntime(18680): at
android.app.ActivityThread.access$1600(ActivityThread.java:150)
E/AndroidRuntime(18680): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
E/AndroidRuntime(18680): at
android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18680): at android.os.Looper.loop(Looper.java:148)
E/AndroidRuntime(18680): at
android.app.ActivityThread.main(ActivityThread.java:5423)
E/AndroidRuntime(18680): at java.lang.reflect.Method.invoke(Native
Method) E/AndroidRuntime(18680): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
This is a more subtle and tricky one. The game was built into an .apk, but crashes at runtime due to a class that is not found.
Judging by the method name (zzb) - this is an internal "obfuscated" method inside Google play services. This can happen if you mix multiple versions of google play services together (for example - Firebase at version 9.8.0 with Google play services at a different version).
It's vital to keep all these versions consistent with one another, a task that could sometimes get a bit tricky with the Resolver that does this automatically.
Final Note:
I offer a professional service to assist fixing such issues. Please feel free to contact me in case you run into a similar issue in the future.

Distriqt Facebook ANE won't compile for Android

I am having trouble compiling the Distriqt Facebook ANE for Android.
It works fine on iOS but not on Android.
The error message is:
dx tool failed:
UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: Java heap
space at
com.android.dx.cf.code.ExecutionStack.copy(ExecutionStack.java:66) at
com.android.dx.cf.code.Frame.copy(Frame.java:98) at
com.android.dx.cf.code.Ropper.processBlock(Ropper.java:786) at
com.android.dx.cf.code.Ropper.doit(Ropper.java:742) at
com.android.dx.cf.code.Ropper.convert(Ropper.java:349) at
com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:280)
at
com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:137)
at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:93)
at com.android.dx.command.dexer.Main.processClass(Main.java:729) at
com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) at
com.android.dx.command.dexer.Main.access$300(Main.java:83) at
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
at
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632) at
com.android.dx.command.dexer.Main.processAllFiles(Main.java:510) at
com.android.dx.command.dexer.Main.runMonoDex(Main.java:280) at
com.android.dx.command.dexer.Main.run(Main.java:246) at
com.android.dx.command.dexer.Main.main(Main.java:215) at
com.android.dx.command.Main.main(Main.java:106)
ADT command line:
...
Tried with AIR18 and AIR 16 (updated dx.jar from distriqt tutorial).
My manifest includes all 3 needed extensions:
<extensionID>com.distriqt.Core</extensionID>
<extensionID>com.distriqt.GooglePlayServices</extensionID>
<extensionID>com.distriqt.FacebookAPI</extensionID>
Removing GooglePlayServices makes compilation possible but app crashes when initializing the FacebokAPI.
Using AIR16 without the updated dx.jar also crashes the app directly at startup. The catlog states the following exception:
08-23 14:53:14.793 E/AndroidRuntime(3178): java.lang.RuntimeException:
Unable to get provider com.facebook.FacebookContentProvider:
java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider
in loader
dalvik.system.PathClassLoader[/data/app/air.my.com.zas.lefiner-1.apk]
08-23 14:53:14.793 E/AndroidRuntime(3178): Caused by:
java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider
in loader
dalvik.system.PathClassLoader[/data/app/air.my.com.zas.lefiner-1.apk]
Oddly enough the Distriqt GooglePlusANE which uses Core and GooglePlayServices works fine on both platforms. So i strongly assume there is something wrong with the FacebookAPI extension.
Any help is very much appreciated!
If You are using Intellij IDEA increase Compiler heap size in Actionscript & Flex compiler. This fixed the issue for me.

How can I remove a library from the aar using gradle?

I'm currently building an android plugin for Unity. Because of that I need to include unity's classes.jar, which provides me with some methods in the com.unity3d.player package.
However when i do ./gradlew assemble it also packages the classes.jar into the .aar file under libs/classes.jar.
Now when I add this .aar to Unity and try to build, I get the following error:
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/a$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/a$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/a$a;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/a;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/b$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/b$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/b;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/c;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/d$1;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at SDKMain.main(SDKMain.java:129)
Unity tries to add the classes.jar to it's android build again, but because the classes.jar is already in the .aar, this fails.
How can I exclude the classes.jar from the .aar?
EDIT
This is what I can do with the command line to remove the classes.jar
zip --delete tapfortapunity-release.aar "libs/*"
How do I call this with gradle?
UPDATE: I just found out that this problem solves itself if I just remove the unity.jar dependency from my build.gradle file:
//dependencies {
// compile files('src/main/libs/unity.jar')
//}
(the code compiles just fine, strangely, and no unity.jar in the .aar file...).
(just noticed that the code compiled because there was no reference to UnityPlayer* stuff...)
Same issue here. I browsed a bit and it seems like there is no clean way to solve the problem (yet!), so I guess it all boils down to this:
create a chain of tasks for the installation of your unity plugin (a task to create the Plugin/Android directory for instance, one to Copy the AAR file and native libraries, if any, etc)
remove the file from the zip using a task the previous one will dependsOn
Step 2 can be carried out in one of those following ways:
create an Exec task that will just execute the command you pointed out (this is probably what I'll end up doing, as I'm not really proficient with gradle...). Easy but not portable (relies on an extra utility).
create a JavaExectask and use Java7 support for zips to remove the entry (probably the best solution, but I don't really have much experience here).
try creating a new jar using the suggestion pointed out in this post: Post on gradle-user describing how to create a jar (or aar...) using gradle as Gradle supports zip files, but cannot change them in place (which implies it cannot remove stuff from them). Harder, but will not rely on external tools, so you'll get portability as a result.
It might not be an elegant solution and probably better ones exist, but it's a very simple, and works well
Hope this helps

Flash Builder Export Release Build Fails

I'm having an issue when trying to export the release build of my AIR application in Flash Builder 4.5. After choosing the key to sign the package and clicking finish to complete the export, it errors saying that "Error occurred while saving the project settings: "default" build target cannot be found for the selected project." I've included the error message output to the log in the .metadata folder. Any help would be great as this is baffling to me.
!ENTRY com.adobe.flexbuilder.project 4 43 2011-05-10 15:56:11.432
!MESSAGE Failed to get build target settings: default
!STACK 0
java.lang.Exception
at com.adobe.flexbuilder.project.internal.FlexProjectCore.createErrorSta tus(FlexProjectCore.java:1009)
at com.adobe.flexbuilder.util.logging.GlobalLogImpl.log(GlobalLogImpl.ja va:66)
at com.adobe.flexbuilder.util.logging.GlobalLog.log(GlobalLog.java:52)
at com.adobe.flexbuilder.project.ui.utils.ProjectBuildPackagingUI.doAppl ySettings(ProjectBuildPackagingUI.java:754)
at com.adobe.flexbuilder.project.ui.utils.ProjectBuildPackagingUI.applyS ettings(ProjectBuildPackagingUI.java:781)
at com.adobe.flexbuilder.exportimport.releaseversion.ui.ExportReleaseVer sionBuildPackagingPageContent.saveSettings(ExportReleaseVersionBuildPa ckagingPageContent.java:131)
at com.adobe.flexbuilder.exportimport.releaseversion.ui.ExportReleaseVer sionBuildPackagingPage.saveSettings(ExportReleaseVersionBuildPackaging Page.java:84)
at com.adobe.flexbuilder.exportimport.releaseversion.ui.ExportReleaseVer sionWizard.performFinish(ExportReleaseVersionWizard.java:144)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java :811)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java :430)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersio nAction$1.run(ExportReleaseVersionAction.java:97)
at com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersio nAction.run(ExportReleaseVersionAction.java:103)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:2 51)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginActio n.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContri butionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionC ontributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.ja va:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav a:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.adobe.flexbuilder.standalone.FlashBuilderApplication.start(FlashB uilderApplication.java:108)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl e.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli cation(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec lipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:179)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Update:
I have tried what J_A_X has recommended. Unfortunately none of those work. It seems to be a problem somewhere within the project settings. We have also tried running the export release build for this project on different machines with fresh installs of flash builder, but the same error message is produced every time. We've looked through so many settings it may come down to having to create a new project and copy all the code into the new application.
Although quite an old post I have just run into the same problem using Flash Builder 4.6. I am fairly new to Air/Flex/Flash etc so apologies in advance for any terminology errors! Still whilst trying to export my new project I did come across exactly the same error as you, and after a lot of searching on Google and starting to lose the will to live, tried Bing and found this link http://forums.adobe.com/thread/850398?start=0&tstart=0
When your Flash Builder project is closed edit the .actionScriptProperties file in Notepad and have a look for a buildTargets section - in my file this was simply <buildTargets/>. I replaced it with the snippet Sandeep had posted in the forum
<buildTargets>
<buildTarget buildTargetName="default">
<airSettings airCertificatePath="" airTimestamp="true" anePathSet="false" version="1">
<airExcludes/>
<anePaths/>
</airSettings>
<actionScriptSettings version="1"/>
</buildTarget>
</buildTargets>
To my delight it was then possible to export my application as a release build.
By the sounds of things from other forums, for your settings file to be in this state in the first place may be due to older versions of FB or in my case I'm pretty sure it is because I used AIRLaunchPad to create my project - which did seem like a good idea at the time. Anyway I hope this may help anyone in the same predicament!
I had a similar issue and solved it..
In Flash Builder, you have to right-click your project -> properties
Click "ActionScript Applications" in the left column
Click Add, and select your main document class, which would be specified in Flash
Professional
Look like an eclipse error. Try to restart eclipse and see if that helps. Might be that Flash Builder was mis-installed (which normally means you see other error) or that your memory settings are too low, you should check your eclipse.ini to increase memory.