How can i specify attribute of my own ViewGroup(Layout) in an axml file? - android-layout

I'm trying to adapt Ravi Tamada's blog entry to Mono for Android.
But at the 6. step i stopped. How can i specify
<!-- Your package folder -->
<com.androidhive.dashboard.DashboardLayout ...
attribute, at fragment_layout.xml file?
I try to give a package name specified at Xamarin solution or specify my VS2010 namespace at java form (MySolution.MyProject.MyFolder.DashboardLayout -> mysolution.myproject.myfolder.DashboardLayout) but result is same error:
Design mode gives following: "the layout could not be loaded: com.android.layoutlib.bridge.mockview cannot be cast to android.view.viewgroup"
The question is, how can i use my DashboardLayout.cs (ViewGroup) class as attribute like Ravi Tamada's java example. (6. step)
Thaanks.

Unfortunately, this is a bug in Mono for Android/the Designer and is already filed on Bugzilla here: https://bugzilla.xamarin.com/show_bug.cgi?id=7680
Hopefully this will be fixed soon, you can CC yourself on the bug so you can updates when anything changes.

Related

Why is my android studio kotlin plugin version in different format than my co-workers?

I stumbled into an issue where all my unit test classes fail to run, providing the following error:
java.lang.IllegalStateException: Failed to transform class with name <my class name>. Reason: toPrettyPrint (Ljava/lang/String;)Ljava/lang/String; in <my class name>: inconsistent stack height -1
One user commented on the following github thread for powermock, that the same error first happened to them after updating their kotlin plugin:
https://github.com/powermock/powermock/issues/779
After reading this, I have checked with my colleagues to see maybe they have a different kotlin version, and saw that their kotlin plugin version is
203.1.6.0-release-798-AS7717.8, whereas mine is 1.4.32-release-Studio4.1-1.
What I find peculiar abbout this, is that these versions dont follow the same conventions, they look more like two completely different sofware. Is there any way for me to get the same version for my kotlin plugin ?
Any help or clarification is much appreciated, thanks!
They probably just changed the naming scheme for the plugin. Looks like you have one that is about one and a half years out of date.
Anyway, go to File -> Settings -> Languages & Frameworks -> Kotlin and click the Install button.

How to make gnuhawk component AudioSink load to redhawk?

Running CentOS 6.5 and RedHawk 1.9.0, and I have audio-components installed in $SDRROOT, and AudioSink shows up in palette, all good. However when I double click to launch it I get the error:
Launching component AudioSink_1 has encountered a problem
and
Failed to launch: AudioSink_1.
When I click on details I get:
Failed to launch: AudioSink_1
and
IDL:CF/ExecutableDevice/ExecuteFail:1.0
Not very informative. Components AudioSource and AudioTestSource also do not launch.
I was having a very similar issue to what you described when I was trying to use Axios-Engineering's RTLTcpSource component. What the issue was for me was I was installing the component incorrectly. So for me this is how I installed a component in REDHAWK.
Download the original source code. (unzip if necessary)
Open the REDHAWK IDE(eclipse)
File->Import...->Existing Projects into Workspace->next->select the source code folder->Finish
Project->Build Project
Drag project folder to "Target SDR" in the SCA Explorer
I hope this helps you or anyone else. I know there aren't really many places that tell you how to actually add an external component to REDHAWK and it took me a while to figure out to just treat it like a normal custom component.
I had a similar problem when using audiosink. The answer above by JD will work but make sure you re-gen the component since the code was made in 1.84 and there is a new codegen for 1.9.
It may also throw a message saying there are errors when exporting to the target SDR but that can mostly be ignored from my experience.
Similarly if you want more of an output, you can run the component/device through the terminal sandbox after building it and set "-Debug 4" to get more information.
Good luck!
edit: seems like a bug with audiosink was addressed: AudioSink unknown error
you might want to just pull down the updated version and try that!

Groovy and IntelliJ - getting code compiled

I have IntelliJ 12 and some groovy code (along with a pile of java code) in a project.
In intelliJ, i can see class A's import of some groovy code, and i have also included the library that has that code.
However, while the package itself is in one colour (for the import), the actual class being imported is in red, which implies an issue of some sort. Hovering the mouse over it reveals no issue though.
When i run a "make" or a "rebuild project" is where the problems start - i get
Groovyc: unable to resolve class com.blah.blah.blah.A
How can i resolve this?
Currently, my project setup is like so:
Under "Libraries" in (Project Structure -> Project Settings -> Libraries) I have:
the jar file with all the groovy code
the src jar file with all the groovy code
In the "Modules" section i have the - well, i don't know what to call it, the column isn't labelled - the library name from the libraries section associated with the src and class files, and the little "export" button beside it is ticked.
Incidentally, opening the class in intelliJ never shows the source code, which given the source is included struck me as weird.
Is there anything else I should need to do?
I've worked this one out, but if anybody knows why groovy cannot be in the "Resource Patterns" list and wants an upvote, do chime in
Oh, right.
I removed the !?*.groovy entry from the list of, um, entries in the File : Settings -> Compiler -> Resource Patterns thingy.
It doesn't seem to matter if "use external build" is on or off for this, but the !?*.groovy; entry cannot be there.
I wonder if anybody knows why?
I had the same problem and had to Add Framework Support and add Groovy to the project to get round this problem.
I created the project using gradle.
I just got your question in my Google results as I had a similar issue. My problem was that I was able to get the groovy code in my IntelliJ 12 project to compile ok, but it wasn't getting wired in properly when I tried to run unit tests within the IDE.
After some investigation, I uncovered that groovy and logback libraries were all set up in the project to be available in the runtime stage of the Maven build of the project, but that resulted in them not being available in the test stage. To fix this, I ended up manually updating the groovy-all and the logback libraries scope from runtime to provided under File->Project Structure->Modules->Dependencies. This allowed me to both compile and test within the IDE while including the Groovy modules as well as the Java modules.
Perhaps you had something similar going on in your project?
Six years later, I also just got this question near the top of my search results.
In my project my Unable to load class 'groovy.text.SimpleTemplateEngine' problem was actually due to a codenarc issue. I was able to resolve the issue by adding the following to build.gradle:
// codenarc version issue work-around
configurations.codenarc {
resolutionStrategy.eachDependency { DependencyResolveDetails d ->
if (d.requested.group == 'org.codehaus.groovy') {
d.useVersion '2.4.7'
}
}
}

Lunching atl files using ATL plugin

I am using ATl plugin to lunch atl using java class.
Before i was running ATL files by using ATL configuration wizard.
The input i was giving in the configuration were:
ATL Module: sample.atl
Metamodel UML: sampleprofile.uml
Source Model system: samplemodel.uml
Target: output.uml
After running the output was the correct and the one i wanted.
The problem is that when i use the ATL plugin to lunch the atl files it only requires me as input:
Name of the ATL file and Name of the metamodel.The problem is that i dont know where to specify the samplemodel.uml. Because this should be also as input. Therefore the output.uml i am getting is not the one i am expecting to get.
Does anyone know how can i specify this second file inside the generated java class ?
Thank you in advance!
you don't need to change the generated java class. Just import the generated class (for instance Families2Persons) from your java program and launch the transformation like this:
Families2Persons runner = new Families2Persons();
runner.loadModels("/pathto/samplemodel.uml");
runner.doFamilies2Persons(new NullProgressMonitor());
runner.saveModels("/pathto/output.uml");
If you want you can also launch the transformation from command line passing the two paths as arguments.

Compile errors with subsonic 3.0 activerecord?

Note, I have used subsonic 2.2 extensively and love it. This is my first experience with 3.0.
I want to add subsonic to my class library rather than the website. First when I do this, and try and run the custom tool to compile the template files, I get errors saying there is not app.config file. In subsonic 2, I was able to do this and point it to my web.config file. So first question is can I use the web.config file when adding subsonic to an external class library?
The second thing that I'm experiencing are 44 identical compile errors.
This is the error from VS 2008:
Error 44 'krazyCommon.model.atDB' does not contain a definition for 'Provider' and no extension method 'Provider' accepting a first argument of type 'krazyCommon.model.atDB' could be found (are you missing a using directive or an assembly reference?) C:\dev\krazybuys\krazyCommon\model\StoredProcedures.cs 175 100 krazyCommon
and this is the code that is causing it. The end of the line this.Provider is where the error is being caused. In VS it has a squiggly line under it.
public StoredProcedure aspnet_UsersInRoles_RemoveUsersFromRoles(){
StoredProcedure sp=new StoredProcedure("aspnet_UsersInRoles_RemoveUsersFromRoles",this.Provider);
return sp;
}
I'm perplexed as I think I'm doing everything correct. Any help would be appreciated.
Many Thanks.
Update, I did find the cause of the compile error. I changed the namespace in the settings file. However, the namespace did not update in the storedprocedure.tt output. It does change for activerecord and content, but not storedprocedures. I manually changed the namespace and it compiled without error.
Is this a bug in the template or subsonic?
Is it possible to change the namespace in settings? And if so, should subsonic pick that up if you right click on activerecord, content and storedprocedures and "Run custom tool" again.
Thanks
Sorry I forgot to add that I did add an app.config file to the class library and added a conn string before I got the 44 errors.

Resources