How to create a static web project in IntelliJ IDEA 2022.2.2 - intellij-idea

I am trying to create a new static web project using IntelliJ IDEA 2022.2.2.
This type does not appear and I have read old questions and answers in StackOverflow but did not work with me.
I like to see the Icon of "Static web" project Like that :
Within an old question there is an answer saying that it is renamed to JavaScript instead of Static web, but for me I have the JavaScript and when click on it I cannot see the same word at the right side:

In 2022.2.2, it's New project > JavaScript:

Related

How to create a Kotlin console application with Gradle in Intellij IDEA

I found this tutorial from JetBrains: https://www.jetbrains.com/help/idea/create-your-first-kotlin-app.html?section=Gradle%20Kotlin
It is dated August 19th, 2020.
I am using the same IntelliJ IDEA version as in their documentation: 2020.2.
However, my project creation wizard looks quite different from theirs.
They provide this screenshot:
But for me, it looks like this:
and when I click on Next:
I don't see where I can choose the Console Application template, or Gradle.
I found a second tutorial - https://kotlinlang.org/docs/tutorials/jvm-get-started.html , which shows yet a third variation of the New Project wizard:
Are the tutorials out of date? Am I doing anything wrong? How do I create a Kotlin project, based on a console application template, with Gradle?
The wizard you have seems to be obsolete now. There was a brand-new one, released as a part of Kotlin 1.4 recently(see here). Most probably, the problem is caused by the Kotlin IDE plugin being outdated or something. Please try to delete in and re-install using the Preferences -> Plugins menu. Comment here with the results, please. I'd like to know if this would help.
Indeed it's quite weird, I've never seen the dialog to look like yours (mine looks like the one in the tutorials). However, choosing the template doesn't do anything special - it simply creates the main file, which you can do so yourself.
So create a new project with the "JVM/IDEA" option. If it already opens up a main.kt file, you don't need to do anything else. If it didn't, look in the src folder - you should see a folder named main with a folder named kotlin (with a blue icon instead of grey) inside - here's where you wanna create your main file (right click -> new kotlin file/class -> main.kt and make it a file, not a class). Finally, put this in the file:
fun main(args: Array<String>) {
println("Hello world!")
}
Note: if you don't have a kotlin folder, create the file in the folder with the blue icon (might even be src). Also, if this doesn't use Gradle (for some reason), create a Gradle project instead, and at the "Additional libraries and frameworks" option, uncheck Java and check Kotlin, then continue with creating main.kt if it isn't created.
You may create a Kotlin + gradle project from the terminal:
$mkdir myProject; cd myProject; gradle init
follow the tutorial.
And then start the Intellij & open the dir
You're good to go
Same process like this
The same happened to me but I figured out how to fix it:
Just disable Material Theme UI.

"The type or namespace name 'App' could not be found" Xamarin Forms

I am trying to create a simple app in Xamarin Android with Xamarin Forms using Visual Studio, however I keep getting this error everytime I try to build. I have double checked my references which should contain the Portable project, as well as made sure I have the latest version of Xamarin.Forms. What could I still be missing that would give this error?
using System;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using App2;
using Xamarin.Forms.Platform.Android;
namespace App2.Droid
{
[Activity(Label = "App2", Icon = "#drawable/icon", MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity :
global::Xamarin.Forms.Platform.Android.FormsApplicationActivity // superclass new in 1.3
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App()); // method is new in 1.3
}
}
}
In my case, I found there is a bug with Visual Studio 2017 when making a cross platform Xamarin Form app with the generated code if there is a dash in the filename.
It looks like it tries to snake case the title and then complains about not finding that file.
For example, for "my-project", it starts looking for "my_project" in some areas of the generated code.
Using a project name with no symbols seems to solve the issue.
If you're still having issues check to see that the PCL project is referenced under the references in the solution explore
the refrences option in the solution explore
Right click on the references option and click add reference.
in the dialogue box, select the PCL project and click okay.
this should solve the error
Found the source of the error! If anyone else is struggling, try updating Xamarin.Forms using NuGet Packages for Solution. I was only using the Package Manager Console which was not giving me the latest version.
Check whether the namespace you defined in pcl under which the class App() is created is defined in Android project. For example, If your pcl class App() is present under the namespace called App2, then you need to add this namespace in Android project as follows,
using App2;
Check this out if the problem is still not resolved :
Go to
project -> Reference - right click and select -.> Add reference -> from left side
select Project -> solution -> then (check ) select Project name --> OK
finish
I was renaming the projects of the solution and had this same error. What I have done is delete the reference to the .Net Standard project and readded with the new name to the Android project.
My case is really rare but I had the same issue and the problem was that I referenced two pcl projects that referenced Xamarin.Forms (one standard shared project and another my custom library with UI controls). Removing dependency to the second one solved the problem.
This answer is not related to Xamarin, but might help others in the future seeing the same error message. This was an ASP.NET 5.0 Blazor Web Assmebly project and I was developing using Visual Studio for Mac.
I got this error when I had renamed a project from Foo to FooBar.
It turns out, VS did not refactor the namespaces in any classes I created, so the root namespace was left as Foo, which was where the startup Program class was, yet the framework was searching for the App.razor file in the project root, which had been renamed to FooBar.
To fix this, I simply renamed the namespace of the Program class from Foo to FooBar.
In my case, the android and iOS projects could not find the PCL.
I had to import the PCL as a project into Android and iOS. Rebuild solution and you should be fine!

Add external libraries to my project issue

I try to add external library to my current project, but my project can't pick up the library.
I have MyLib.java file in other directory.
/Users/cat/myfile/github/JavaLib/MyLib.java
I want to my current project (/home/project/HelloWorld/HellowWorld.java) to use my MyLib.java
I'm following the steps to add Library to Intellij(15CE)
Menu->Project Structure->Libraries
click (+) symbol->select Java -> select my path(/home/lib/)
Here is the screenshot
Now that you have added your JavaLib directory to the project you should be able to use the code inside JavaLib in your code now. Intellij should offer auto-complete when you start to type the name of a JavaLib class and automatically include the import for you in your code.
The disabled Apply button you circled isn't an issue. I get that in my view too. It just means nothing has changed that needs to be applied currently.

How do I create a file with the iOS\Cocoa Touch\Objective-C class template in Xcode

Forgive how simple this might sound but I'm stuck and need help. I am putting In App Purchases into may first app, which is not yet released. (So I'm very new)
I have been using a tutorial by Ray Wenderlich. I have just finished starting the Master Detail Application Template. Now it says I need to create a IAPHelper class which will be my class for the IAP the step I am on says to "create a file with the iOS\Cocoa Touch\Objective-C class template". However when I open Xcode and I select new project, I don't see this option. It has Single View Application etc.. the closest thing I see is Cocoa Touch Static Library.
Can someone tell me how I "create a file with the iOS\Cocoa Touch\Objective-C class template". I'm lost, do I do it from inside the Master Application Template? Or do I use some other template name like utility or empty application or Cocoa Touch Static Library? Or do I not have this in my version of Xcode? Or am I totally coming at this the wrong way? ahhhh!lol
I have Xcode 4.3.2
I know this is probably a no-brainer for some but not for me :(
Thanks for the help :)
In the current project you are working in, right click on a file and click "New File..." or go to File>New>File and then you will probably want a Objective-c class objection under Cocoa Touch
You need to do this in the same project which you have done till now. What you are trying to do is to create new project where as the tutorial is asking you to create new file. You have to do this in the same project which you are working on. In order to do that there is an option in file menu to add a new file to project.

After adding new class file to App_Code, build action is Content instead of Compile

In VS2008, I am adding new classes to a web project.
When I right-click on App-Code -> Add -> New Item -> Class ...
The build action for the newly created item is set to content instead of compile. This seems like it would be a problem with the template. I've found several others through google who have run into this issue, but nobody seemed to have found a more permanent solution, other than "change it from content to compile after creation."
My question: Does anyone know of a fix for this, official or otherwise?
App_Code is a special folder meant for folder based projects.
This is just a hunch, but it might be that you have a project file based project, instead of a simple folder based one.