Android Studio - problem with kotlin script - android-studio

On my first day of my kotlin journey I ran in to a problem. I really don't know Android Studio well so please if I didnIt express my question completely, ask me.
I'm learning through YouTube video Kotlin Android Tutorial | Learn How to Build an Android App. I Was able to create an Android simple app Hello world and run it on my PC and mobile phone, when I get to work with kotlin script problem occur:
Manifest merger failed with multiple errors, see logs
3x
android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined
The app is working, but when I want to run just kotlin script I get errors.
Solution which I found here: Manifest merger failed : Apps targeting Android 12 - Android Studio Error
Is not working for me. I tried lower the SDK but nothing.

You need to specify android:exported="false" or android:exported="true" in the AndroidManifest.xml file, in the manifests package. Bye bye Jason

Related

Flutter UI Guides not showing in Android Studio

In Android Studio V4.1.3 (build no. Al-201.8743.12.41.7199119) The Flutter UI guides for widgets and methods not showing at all even though it is enabled in the settings. Please, be kind to see the screenshot =>
no Flutter UI guides
I have Flutter Plugin V55.1.1 and Dart Plugin V201.9335 installed.
All your help is highly appreciated.
Thank you
You might be creating the new Flutter project and selecting Java for Android. But when you select Kotlin and create project. The issue will be fixed.
And if you want your old projects to be converted to Kotlin, just open the terminal in that project and run this
run flutter create -a kotlin .
The dot(.) at the end is also important it will generate the Kotlin files in current directory.
After this, just re-open the project, you'll get the guides.
I have the same android studio version as you and Flutter Plugin V55.1.1 and Dart Plugin V201.9380 installed. Getting the same issue. I have even tried to enable and disable the "Show UI guidelines for build methods" in Setting > Language & Frameworks > Flutter, but nothings work.
I cloned flutter/sample from GitHub and it seem that the UI guides is showing on that samples project.
My current (kinda easy cheat) solution right now is by creating a New Flutter application project via VS Code. And when I open that flutter project on Android studio, the UI guides is there. I have configure my VS Code with the recommended setting for Dart code.
Tutorial to configure your VS Code reference: https://youtu.be/nAmOt5_fMtU?t=278
I'm pretty new in flutter development but I'm pretty sure there might be something that we can configure on Android Studio seeing that generated project file from VS Code does shows the UI guideline. If someone know how do let me know. Cheers!

AAPT: error: failed writing to 'c: ....\r.txt': The data is invalid. (13)

First off, I am a student learning the basics of app development in Android Studio. With that in mind, please don't answer in short hand, acronyms or other technical jargon as I probably won't know what you are saying.
I have tried several fixes that appear across the web for this issue. These fixes include, using the clean and rebuild options under Build in android studio. Fully uninstalling and reinstalling Android Studio, running the program and creating a new app and then looking for the error, the invalidate cache / restart option under file and changing the android gradle plugin version and gradle version under Build > edit build types > project tab. None of these have been successful.
The error popped up for me in September or early October after an update. I was able to create my hello world app and our first simple app without any issues. After the error appeared all apps refuse (including the ones that were working previously) to run or render in the emulator because of this error. I have spent hours of 'office hours' with the instructor who has years of experience with android studio and this has him stumped as well.
I have 2 weeks of this course left and a final project to create. I would be eternally grateful for a solution to this problem.
Thank you.

Android Studio for Dart without emulator

Is it possible to use AndroidStudio (for Dart) withOUT running an emulator?
Context: I am a complete newbie and have started reading some intro books and following online tutorials. I am aiming to learn DART and FLUTTER and have successfully installed AndroidStudio and an emulator and ran some successful test projects like helloworld.
The thing is, these early example projects are VERY basic things, to teaches me about variables and syntax etc and outputs results to the console. At this point, i do not need to boot up an entire emulator (which adds a layer of clunkiness when running)... but AndroidStudio seems to insist on one being activated?
I could use "DartPad" (which i love) for simple stuff - but it's limited and i'd prefer to learn one dedicated IDE if possible.
It depends on what you are actually running. If you are using Dart alone, you should be able to run it. Personally, I do these kinds of projects within IntelliJ Idea - which Android Studio is based on anyway, but doesn't come with the Android "overhead". Microsoft Visual Studio Code is another valid option that many people use.
If your project is based on Flutter (i.e. it contains UI), you need a "device" to run on - it might be the Android emulator, iOS simulator, Chrome or native (experimental).

How to resolve symbols #mipmap and #style in Flutter project?

A while ago my designed Flutter app was running like it should in simulation (virtual device) in Android Studio. After some updates of both Flutter as Android studio I am not able to get the app in simulation. I am new to Flutter and Android studio (have a little knowledge of Xcode, 2 apps in the store) so I have looked at stackoverflow first to find a solution. All tried suggestions did not worked for me and I am hoping somebody can help me.
I have an original version of the project which was running in simulation mode. Now I am working in a duplicated version to find out how to get things up and running again. It worked before but why does Flutter or Android Studio give an error now? The folders and content do exist. Perhaps it is a simple thing to solve but it is not in my knowledge.
What to do to solve the error message I get as shown in the screendump?
The problem seems to be with the resources,
this should help.
Android Studio error: cannot resolve symbol in Xml
Or try to run "flutter clean" (usually solves many problems)
Flutter studio sometimes does not resolve those (no idea why).
Try opening the same Android project in Android studio and check it from there.
Once back, try File->Invalidate Caches/Restart
If they exist and the name is right (without extension), then it could be it.

How do I migrate my Flutter project from vscode to Android Studio?

I created my Flutter project by typing into my CLI Flutter create project_name and all this time I've been coding using VScode, and the project is near completion, which means I have to do a software demo in the coming days to my professors in university. However, I would need to open multiple android emulators that will run the same project, based on my brief research and testing, VScode does not allow running multiple android emulators that run the same project. So I have to transfer that project from VScode to Android Studio.
I've tried simply opening my Flutter folder in Android Studio and I'm getting gradle build errors. Any help would be appreciated thank you!
As long as you have the Flutter plugin installed in Android Studio, you can just open the folder like any other.
Though FWIW, I don't know if Android Studio supports debugging on multiple devices at the same time. It does work in VS Code (as shown at Flutter Interact with the "Flutter Octopus") if you're on the master channel (see https://github.com/flutter/flutter/wiki/Multi-device-debugging-in-VS-Code).

Resources