I am following the hands on tutorial on KMM, and reached the point where I should write the iOS part of the app, however, when I head over to any of the .swift files, there's no syntax highlighting, the content appears as a plain text file.
Android Studio: 4.1.1 (latest at the moment of writing)
KMM Plugin: 0.2.0-release-65-Studio4.1 (latest at the moment of writing)
From what I see, the iosApp is not recognized at all as a module (like the androidApp, that has the name of the module highlighted via bold font), I suppose that is the issue.
Any thoughts on how to fix this?
You'll need to use Xcode or (possibly) AppCode. Android Studio and the KMM plugin do not understand or highlight Swift code directly.
If anyone runs into the same issue with AppCode not highlighting Swift, I just had to close the project and reopen it.
Related
I have a problem and I would like your help :)
I received a native Java project from Android Studio and I want to know how I can configure my environment, the first time I tried I had a lot of errors with gradel.
Is there a way to know exactly what settings are needed to start project maintenance?
As long as you have installed Android Studio and are able to create sample projects, you should be set up.
Gradle should show you all the problems which your legacy project has. I assume, that you will see a lot of warnings which can be ignored at first.
You might have problems with a missing key.properties file.
Some dependencies might not be available anymore.
You have to resolve all the issues manually. There aren't any special settings.
I'm getting red letters in my AndroidManifest.xml and don't understand what they mean. At the moment everything seems to be working as should. But will I get any problems down the road?
Nope, Android Studio can't understand the Android content when a Flutter project is opened.
It can either understand the Flutter directory structure when Flutter is opened. This is what enables Code Completion and other nice features when making Flutter apps.
If it's a simple Android project, then it can easily understand the Gradle files and your Java/Kotlin.
What this means for you as a Flutter developer is that, when you are editing native Android or iOS code. You will not get code completion. Android Studio will not be able to tell you about the errors in your code.
The Flutter team is working on this. So that you can have all the cool IntelliJ features for editing Native code EVEN when you have a Flutter project is opened.
Also, I think if you open the android separately, then you should be able to see properly. (Maybe, I'm not sure).
You can now open the Android part of your Flutter project by right clicking on the project name in the project window, choose Flutter and then Open Android module in Android Studio.
The opened Android project will have code completion and all the red letters will most likely turn other colors :)
I am working on a Flutter app inside of the latest stable version of Android Studio. I need to use a native SDK in this project since that vendor does not yet support Flutter. The example I am working off of was using the old support libraries and that was causing trouble so I am migrating things to androidx. I notice though that as I attempt to fix the errors in an Activity, like Unresolved reference: AppCompatActivity for example, that Android Studio does not recognize the Activity as a Kotlin file. In other words, none of the hints that show up work and in fact, no typo is ever shown as a syntax error. It's treating the Activity like a plain text file! You can type anything you want (like this_is_clearly_a_syntax_error as a line by itself) and no highlighting of an error will occur.
How do you get the Kotlin files to be treated like they do in a normal Android app?
Looks like you have to go in an physically mark the android directory as Source. So, go to File->Project Structure then select Module on the left. Left click on Android, then select Source then hit Apply.
I have succeed to run my android project from Eclipse to Android Studio simply by generating its gradle build (without changing the project's structure).
I would like to change this project structure to the Android Studio's format, however im afraid this p**roject will not be working anymore in Eclipse**.
Have someone did this before?Did the re-structured project still working in Eclipse? (I have a bad feeling about this)
Note : If you wondering why i dont try it before asking, its because the project is fairly complicated (around 5 libraries also need to be restructured and i only know a very little about gradle) so it will be nice if i know it will be working.
Thanks everyone.
I've been using eclipse to develop Android apps with phonegap until, a few weeks ago, I decided to try Sublime Text 2. I found it to be so much better than the eclipse editor so I would like to keep using it. Only thing I'm missing is a quick way to test the app on the device inside Sublime.
Luckily, someone else also had the same idea and developed a plugin for this:
https://github.com/Korcholis/Andrew
Sadly, I cannot get it to work, I installed ant and pointed the plugin to adb but then nothing happens when I try to create a new project (and there is no error message in the console).
I also found this other plugin:
https://bitbucket.org/ucomesdag/sublime-android
But I have no idea on how to install and run it.
Did someone else found a way to do this?
A quick update into 2014.
As of PhoneGap Cordova 3.0, it is no longer required to develop Android apps via eclipse. You are free to use any code editor or IDE you wish as app building is done independently from eclipse via a simple command line.
cordova run android to package the .apk and install on any active devices detected by adb or
cordova build android to package the .apk only.
In your case, you can keep using Sublime and pop in the cordova run android command whenever you ready to go on a test run.
While I agree with Insane Coder that you should stick with supported IDEs to develop for Android, according to this link and existing Sublime Text 2 Ant support, you could build and develop your android project with this IDE (It will just take some time to set it all up... as opposed to using a supported IDE like IntelliJ or Eclipse).
Using PackageControl, look for "Ant". That will install syntax highlighting for Ant. Another plugin that enables the build command (ctrl+b) to work for Ant files, "Super Ant". You should be able to code for android in sublime text 2 with those installed.
On another note... Do you use windows? The Andrew project you link to, seems to have Windows compatibility issues. Apparently related to locating the "SDK" (he says sdk in Andrew's github page but, probably he means JDK?) in your hard drive. Which is probably a hassle because Windows typically installs stuff to "Program Files" and in code, that turns into "Progra~1" because of the space. In the link I give you there is another approach to it, so when you install the JDK set a folder that has no spaces in its name, like c:\java\jdk1.6.0_02 or something else that strikes your fancy. The problem you could be having with Andrew is that it isn't finding the jdk in your hard disk.