package [...] does not exist - gradle

I'm stuck for some time now here. I'm trying to create a library that will make use of another Java library generated using swagger editor. I added the swagger library to the main module and apparently it doesn't show any resolve conflicts or what so ever... I can also use auto complete to state import io.swagger.client.ApiClient. Here is a prt screen:
When I run a simple test file that instantiates an EGroupsHandler class, I get this error. Which is odd to me because I can even Ctrl+Click to jump to the definition of the class inside the external libraries. Any help? I'm using
Gradle 7.0.1
IntelliJ 11.0.2

Related

.jar bindings not created correctly in Xamarin

I have a external .jar library that I need to import to my project, I have followed the official Binding a .JAR guide and added the .jar as a "EmbeddedJar".
It seems to work fine and I can use the library, but I have now noticed that some minor classes did not get bindings created correctly and the methods/fields are not accessible. I don't get any errors, the expected fields/methods just don't exist. But I do see them when inspecting the .Class object.
What can I try to make sure all classes gets converted correctly? Or, worst case, is it possible add these manually somehow?

plugin was built with a different version of package crypto/internal/boring​

I have a code in golang that is using buildmode plugins. I am building the main program and the plugins inside the same image (goboring/golang:1.15.8b5) and one after the other. When running the main program, as soon as it tries to load the plugins, I get the error:
E0319 14:27:38.417362 34123 daemon.go:639] loadVendorPlugins(): fail to load plugin /plugins/my_plugin.so: plugin.Open("/plugins/my_plugin"): plugin was built with a different version of package crypto/internal/boring​
This does not happen if I change the image to golang:1.15. Any idea why a different version for a package is found even if both are built in the same image? Why the base image might have an impact on this?
Apparently, when using the buildmode=plugin, it is not strange to see this problem. The solution is to add the flag -trimpath to the go build, as explained here: https://github.com/golang/go/issues/27751#issuecomment-593082117

Can a Xamarin Android bindings library behave like 'compileOnly' in gradle?

I am trying to write a Xamarin Android binding library for a library that is loaded in the app during runtime. When using this library in a normal Android project, you would use "compileOnly".
compileOnly 'de.robv.android.xposed:api:82'
compileOnly 'de.robv.android.xposed:api:82:sources'
From my understanding, "compileOnly" makes the code from the library available for compilation but does not add it to the resulting apk. Meaning it needs to be provided in runtime for the app to work.
When reading the Xamarin binding Build Action docs, "compileOnly" sounds very similar to "InputJar".
Does not embed the .jar into the resulting Bindings Library .DLL. Your Bindings Library .DLL will have a dependency on this .jar at runtime. Use this option when you do not want to include the .jar in your Bindings Library (for example, for licensing reasons). If you use this option, you must ensure that the input .jar is available on the device that runs your app.
However, when compiling my application while using methods provided by the runtime library, I get errors from the generated java code that the packages do not exist.
javac.exe error : error: package de.robv.android.xposed does not exist
javac.exe error : de.robv.android.xposed.IXposedHookLoadPackage
javac.exe error : error: package de.robv.android.xposed.callbacks.XC_LoadPackage does not exist
javac.exe error : public void handleLoadPackage (de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam p0)
error : error: package de.robv.android.xposed.callbacks.XC_LoadPackage does not exist
error : private native void n_handleLoadPackage (de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam p0);
Meaning that the code was not made available during compilation. How can I make sure the code is made available during compilation but not embedded into application?
See my answer at https://stackoverflow.com/a/64973909/4374462
Either using AndroidExternalJavaLibrary or [assembly: Java.Interop.DoNotPackage("ref.jar")].

How to Import Swift Source Code into a XCode Swift Project

I've written a working swift prototype. It contains a parent class and some subclasses. I want to be able to import the parent class into another project where I will create sub classes for it.
I created a new XCode project for a dynamic library, added the parent class to it and ran build. I've seen where you can't use static for Swift code.
I also created a different directory and set up a swift package. The build on it ran successfully.
When I add an import statement to the project where I want to use it, it says it can't find it. The statement is: "import RailsData", the name of the parent class.
I've tried adding the dynamic library project to "Linked Frameworks and Libraries". I also tried adding the swift file directly. XCode flags the import as not found.
The swift package manager example is all command line based so I'm not sure if will work with XCode projects. I would eventually like to make a package out of it.
Xcode 8.2, Swift 3.0. I'm pretty sure I'm missing something fundamental.
Update
I found a related question. It says to
Put your package manifest file into the same directory as the Xcode project, and then invoke swift package generate-xcodeproj
With a search I found this page that says:
Instructions for how to build a package are provided by the Package.swift manifest file.
So I copied the file to the root of my project and ran the command above. It created a new .xcodeproj. When I opened it, I saw my original files, but not anything from the package. That's not surprising as there is no reference to it's location in the file system. Also a mystery is what happens when you want additional packages. Do you keep generating new projects?
It seems like the missing link is the following command
swift package generate-xcodeproj
Actually Adding Swift 3 packages to Xcode 8 using the Swift package manager should answer your question.

Using ActionBar Sherlock with intellij through maven. #style/Theme.Sherlock in AndroidManifest.xml does not match

Just trying the simplest thing to use ActionBar Sherlock in an Android app using IntelliJ 12.
I've read in other post and blogs and people keep dowloading ABS' source and mavenizing it ( complaining ABS on maven is too old). It turns out on maven we can get 4.3.1 now.
Therefore, I am trying to avoid mavenizing ABS again.
So, I created a blank Android app project with a simple Hello, World activity.
Compiled and ran it, just to be sure.
Then, I went to the Project Structure and added the ABS library via Maven (com.actionbarsherlock:actionbarsherlock:4.3.1).
Added it to the Module that represents my app.
Made sure to mark the library as "Provided" in the Module Dependencies.
The whole thing compiles and run.
Of course, as soon as I extend the main activity from SherlockActivity the app crashes. Expected...
So, I open the AndroidManifest.xml and add android:theme="" to the application tag.
To my surprise and pain, #style/Theme.Sherlock... does not auto-complete, and the compiler complains with the dreaded error:
Error: No resource found that matches the given name (at 'theme' with
value '#style/Theme.Sherlock')
So, my question is what did I miss?
Is there a way to ask IntelliJ to load the resources from ABS?
Thanks.
Adding ActionBarShelock as a library (plain jar) will not work, you have to configure it as a Library module in IntelliJ IDEA and then set your main module to depend on it. See this tutorial.

Resources