Extending Titanium WebViewProxy for Android - Build error - titanium

I need to extend Titanium's Android Webview with some additional functionality, however I'm not able to build my titanium project after including my created module.
My module has the titanium-ui.jar on it's build path and I have copied the original Titanium WebViewProxy.java into my module project. I haven't added any custom code to WebViewProxy.java yet.
This is the project hierarchy of my module, together with the build.properties file.
When building the module, I get an exception but the module seems to get built anyway, this must have something to do with the final problem. When I remove the WebViewProxy.java and keep the titanium-ui.jar on my build path, building the module and including it in my titanium project works fine.
Here's the full console log of the build script of the module: http://pastebin.com/G2LSkFLF
This is what happens when I try to run my titanium project using the generated module (the one, that threw the exception while building)
Does anyone know how to solve this? Maybe some different approach at all? I have some special url schemes in my app and I need to handle them. I have already a similar module for iOS, which works fine.
Thanks.

Ok, I finally found the solution. It was so easy... The WebViewProxy.java had to be adjusted a little bit.
#Kroll.proxy(creatableInModule=UIModule.class, propertyAccessors = {
has to be
#Kroll.proxy(creatableInModule=CustomwebviewModule.class, propertyAccessors = {
UIModule.class has to be replaced with the class name of your Module.

Related

HelloWorld in Kotlin gives error "Could not find or load main class"

I spent the last 1,5 hour trying to make this simple tutorial work in IntelliJ IDEA, as you can see in this video.
When trying to run the code, I get the error:
/[...] -Dfile.encoding=UTF-8 src.HelloKt
Error: Could not find or load main class src.HelloKt
Caused by: java.lang.ClassNotFoundException: src.HelloKt
I have tried setting up SDK, invalidating cache, removing .idea and .gradle, rebuilding project, deleting the profile and adding it again. I tried those actions in different orders.
Here's a screenshot of the project:
It also complains Kotlin is not configured, but I have already configured it.
Here's the run configuration:
Here are the project settings:
Your Hello.kt file needs to be somewhere inside the src/main folder, probably in src/main/kotlin. This is different from the tutorial, because your project is using Gradle, and the one in the tutorial isn't. I think this is because newer versions of IntelliJ use Gradle by default for new projects, which wasn't the case when the tutorial was written.
The use of src/main/kotlin and src/test/kotlin as source code directories is a convention in Gradle (and Maven). When importing a Gradle project into IntelliJ, main becomes a module, and kotlin becomes a source folder within that module. The same goes for test. In your screenshots, the bold text and blue icons on main and test confirm that's how your project is set up. Files outside of those folders aren't treated as source files, which explains why your Hello.kt file isn't being compiled or recognised correctly.
It's likely that the default behaviour of IntelliJ when creating a new project has changed since this tutorial was written. In the tutorial, they select "Kotlin" as the project type and this creates a project that doesn't use Gradle. As a result, the project doesn't use the src/main/kotlin directory structure.
I can see from your video that you selected the same option, but on the next screen, IntelliJ still automatically selected Gradle as the build system for the new project. To match the project structure used in the tutorial, I think you would need to select "IntelliJ" as the build system.

Could not find a declaration file for module '#hmscore/react-native-hms-push'

I'm having problems with linking push kit library.
I'm programming in react-native with visual studio code, library '#hmscore/react-native-hms-push' not seem to be imported correctly, the error is 'Could not find a declaration file for module '#hmscore/react-native-hms-push'.
I'm using 5.3.0-301 version.
Checking maps-kit and push-kit seems different si index.ts, is missing in the src directory of push-kit
i have used this guide:
https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/integraternmodule-0000001050157791
have i missed anything?
Thanks
The solution is:
yarn add #types/hmscore__react-native-hms-push
or equivalent in npm.

Calling *.aar files (android library) in nativescript vue

I already create an .aar (android library) files in android studio and want to call/use it in nativescript-vue project.
I have placed the aar file in "app/App_Resources/Android/libs" folder.
Based on my reading, in typescript the way to call the method in aar files is by calling com.package.MyClass.
My question is , how to call it in .vue files. I have tried to call the method using the same approach but its produce an error :
Module not found: Error: Can't resolve com.package.MyClass
Can someone please help me on this.
Your help is very much appreciated.
You may simply place your AAR file in your App_Resources/Android/libs directory, CLI will pick it up at build time and the native APIs should be available at runtime within your project.
Try a clean build if you see errors, make sure the AAR is picked up. You might be able to verify it from the CLI logs. If you still see issues, make sure the class you are trying to access is public.
I'm not sure it's possible to use the android lib directly in the main project or not. In my way, I create a NS plugin that includes the .aar library, then add this plugin to the main project & use the methods defined in the .aar library without problem.
If you place the .aar library in the main project, you should check if that .aar library is installed by running tns build command & look at console log. If it's installed together with the project, that means you can use the lib method in .vue or any .js files.

Problems archiving project with react-native-fbsdk

I have managed to get react-native-fbsdk (core, login and share) all working in my project. I can build to devices without issue but if I try to create an archive from Xcode I get the error
Lexical or Preprocessor Issue
'RCTBridgeModule.h' file not found
I have followed the install instructions and create a virgin project and done it again to ensure nothing else could be causing this.
Similar Xcode related questions have come up blank for me too:
Xcode 4 can't locate public header files from static library dependency
When archiving app Xcode complains about missing files
Xcode 4 and nested projects -- header files not found
This makes me wonder if there's something else to to with FBSDK specifically that I need to do to get it to archive properly.
Has anyone got a project to archive with react-native-fbsdk? If so, how?
Note: I skipped the step regarding explicitly naming the path for static libraries as I do not know what the name should be; I do not know which the static library would be fbsdkcore (etc) or react-native/react.
I appears that the repo had an error in its header search paths in 'release' distribution. The fix was to correct the xcodeproj in the plugin (A PR is currently going through for this) as outlined here
The following line is present in the debug distribution but not in release for any of the required xcodeproj's
"$(SRCROOT)/../../node_modules/react-native/React/**",
Adding this fixes the error.
Full Source Code Alterations

Unable to set up rhino debugger as a project in my IDE

I am trying to tweak Rhino debugger work with my servlet so I downloaded the sources and for some reason I having some difficulties to set up the project properly in my IDE (intellij).
I have tried to add both the SRC and the Jar file but it seem like there is an .internal. package that get in the way.
For example:
Global that somewhere along the inheritance chain extends from sun.org.mozilla.javascript.internal.ScriptableObject
But who ever is using Global is expecting org.mozilla.javascript.ScriptableObject.
When I build the code using ant, it works fine so I am guessing it is something that I am missing..
Any ideas?
The issue was that IntelliJ was modifying the imports when loading the project.
and the imports got mixed up between the
org.mozilla.javascript...
and sun.org.mozilla.javascript.internal.ScriptableObject
Creating a new project with the whole downloaded zip fixed the problem and gave the right source the was loaded