Why is Android Studio / Eclipse necessary to build an ANE? - actionscript-3

I have used the following process to create a Java-based ANE for Android.
Compile the java files along with their dependencies for Android platform.
Create the .jar file with the Java SDK.
Create the .swc file.
Package the ANE using ADT.
When I use that ANE to package an APK, I get the following error:
dx tool failed:Compilation failed with an internal error. java.lang.IllegalArgumentException at com.android.tools.r8.org.objectweb.asm.ClassReader.<init>(ClassReader .java:160) at com.android.tools.r8.org.objectweb.asm.ClassReader.<init>(ClassReader .java:143) at com.android.tools.r8.org.objectweb.asm.ClassReader.<init>(ClassReader .java:418) at com.android.tools.r8.graph.JarClassFileReader.read(JarClassFileReader .java:91) at com.android.tools.r8.dex.ApplicationReader$ClassReader.lambda$readCla ssSources$1(ApplicationReader.java:231) at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(Unknown Source ) at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
I know I have not followed the conventional route of using the Android Studio or Eclipse, or some such IDE. I just used the command prompt to achieve building the ANE.
What am I missing here? Is there something specific that Android Studio does before it outputs a .jar file that is packaged into an ANE?

Changed the release flag in javac to --release 8 and the APK is correctly created. Earlier, the release flag was set to 16.

Related

Error Implementing lib module dependency by creating .aar file in build-gradle (app) file

I am facing the following issue whenever I try to implement the .aar file instead of the direct lib module dependency.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find :xxxlib-release:.
N:B: I have configured the library project for jitpack also with the publishing config. A few days back, there was no issue but now I am getting errors for both the .aar and jitpack versions of my library which I guess is related. Additionally, I have upgraded to Android Studio Bumblebee and using targetSdkVersion 29 or 30; kotlin = 1.6.0 and classpath 'com.android.tools.build:gradle:7.0.3'
I can't find out what am I missing here. Any help will be appriciated, thanks.

NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String; while launching Chrome using SoapUI

I'm trying to launch the selenium scripts from SoapUI 5.2.1 tool with the following launching script:
System.setProperty("webdriver.chrome.driver","D:\\SoapUI-5.2.1\\bin\\ext\\chromedriver.exe")
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://www.MyUrl.com")
driver.manage().timeouts().implicitlyWait(120,TimeUnit.SECONDS);
I have kept the following selenium dependency file in SoapUI/bin/ext folder
- chromedriver 2.36
- selenium-server-standalone-3.4.0.jar
- selenium-chrome-driver-2.3.1.jar
But I'm getting the following error message while running the script.
Tue May 22 15:51:47 IST 2018:ERROR:java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String;
java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String;
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:84)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:87)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186)
at Script1.launchURL(Script1.groovy:49)
at Script1.run(Script1.groovy:20)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Anyone help me to solve this issue as I'm not able to find correct solution in Google.
Thanks
Karunagara Pandi
This error message...
java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String;
java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String;
...implies that a NoSuchMethodError was raised when the os command findExecutable() tried to locate the executable as per your System.setProperty() line.
Class NoSuchMethodError
NoSuchMethodError extends IncompatibleClassChangeError and as per the Java Docs it is thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method. Normally, this error is caught by the compiler and this error can only occur at run time if the definition of a class has incompatibly changed. Incompatible class change occurs due to change in definition of some class, on which the currently executing method depends.
What went wrong?
You have created the WebDriver instance i.e. driver and casted it through ChromeDriver(). But the SoapUI/bin/ext sub-directory contains multiple defination from selenium-server-standalone-3.4.0.jar and selenium-chrome-driver-2.3.1.jar.
Solution
Perform the following steps :
Remove selenium-chrome-driver-2.3.1.jar from SoapUI/bin/ext sub-directory.
Upgrade JDK to recent levels JDK 8u171.
Upgrade Selenium to current levels Version 3.11.0.
Upgrade ChromeDriver to current ChromeDriver v2.38 level.
Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.
Code to initialize the chromedriver is like the below code mentioned
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver_win32\\chromedriver.exe");
Webdriver driver = new ChromeDriver();
You need to set the correct dependency artifact id of selenium like
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.12.0</version>
</dependency>
if you are using jar file then download the selenium jar file from here Authentic link

Houdini arm to x86 translation "Unsupported feature" error when using shared STL in Android NDK app

I created an Android Studio project from this sample NDK project provided by Google and changed a couple things so I could try to leverage Houdini arm to x86 translation:
In app/build.gradle I set abiFilters to armeabi-v7a.
In Application.mk I changed APP_ABI from all to armeabi-v7a so that x86 native libraries won't be created.
Also in Application.mk, I changed APP_STL from stlport_static to gnustl_shared.
You can see the modified code in this repo.
Then I ran the app in the BlueStacks emulator, which supports Houdini. I get the following error:
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Loading library(version: 4.0.8.45720 RELEASE)... successfully.
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Unsupported feature (ID:0x10600cae).
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Open Native Library /data/app-lib/com.sample.teapot-2/libTeapotNativeActivity.so failed.
...
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sample.teapot/com.sample.teapot.TeapotNativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.sample.teapot-2/libTeapotNativeActivity.so
If I make APP_STL any of the supported values with shared I get this error, and with static it works fine. I'd like to get shared working, to solve this issue in React Native. Does shared STL not work with Houdini? Any workarounds?

java.lang.No classDefFound error while using PEXML for android in Libgx

I am using PEXML library for giving physics to bodies in my game. It worked very well in desktop but when I ran in android it is giving me error at code
playerPhysics = new PEXML(Gdx.files.internal("data/physics.xml").file());
and showing error
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/JAXBContext; at com.hi5dev.box2d_pexml.PEXML.loadXML(PEXML.java:124) at com.hi5dev.box2d_pexml.PEXML.(PEXML.java:24)
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.bind.JAXBContext" on path: DexPathList[[dex file "/data/data/com.myplayer.football/files/instant-run/dex/slice-slice_9...
Google search shows javax.xml.bind.JAXBContext is in the file javax.xml.bind.jar
Java needs to find this file at runtime. It looks for it in your Java classpath ( set of directories ).
You need this Jar to be in your runtime classpath
The error you wrote about shows you the classpath.
You can either
put javax.xml.bind.jar in the current classpath
or
Modify the classpath to include the location of javax.xml.bind.jar
Lookup how to modify the Java classpath for your operating system.

Flash Develop invalid namespace with AIR 14.0

I'm using Flash Develop 4.6.2.5, and I cannot compile my app with AIR versions above 3.9.
I've tried with 4.0, 13.0 and 14.0
Packaging: dist\app.apk
project\application.xml: error 102:
Invalid namespace http://ns.adobe.com/air/application/14.0 APK setup creation
FAILED.
Here is all the procedures I've already did:
After some struggle here is the solution:
Switch the order of the PATH at SetupSDK.bat (line ~35):
Original:
:succeed
set PATH=%PATH%;%FLEX_SDK%\bin
Modified:
:succeed
set PATH=%FLEX_SDK%\bin;%PATH%
The problem should be related with something that I've installed in my system %PATH% which is having conflicts with something from %FLEX_SDK%, by switching the order you are forcing the packager to give preference to Flex SDK.