Android Studio AndroidManifest not found after moving project - android-studio

Recently, I moved my Android Studio Flutter project to another location in my computer by closing the project in Android Studio and then opening it in its new location. This was the error that appeared in my console when I try to run my project again.
What do I need to do?
Launching lib/main.dart on Pixel 3 XL in debug mode...
ERROR: dump failed because resource AndroidManifest.xml not found
Failed to extract manifest from APK: ProcessException: The command failed
Command: /Users/user/Library/Android/sdk/build-tools/29.0.3/aapt dump xmltree /Users/user/Desktop/Coding Projects/Work/Smart Weighing Scale/Mobile App/loadcell_app/build/app/outputs/apk/app.apk AndroidManifest.xml.
No application found for TargetPlatform.android_arm64.
Is your project missing an android/app/src/main/AndroidManifest.xml?
Consider running "flutter create ." to create one.

First of all check AndroidMainfest.xml in project's android folder then please try with flutter clean command in terminal (It's located at the bottom of Android Studio) and then flutter create .

Related

Android studio is giving the following error when I am trying to build a ionic project "Gradle sync failed: Sync failed: reason unknown"

I am trying to build a ionic project in Android studio on Ubuntu 20.04 . I am using the command ionic capacitor build then android studio opens up as expected then it shows this error Gradle sync failed: Sync failed: reason unknown. I am unable find a solution for this particular gradle sync error. I have reinstalled Ubuntu and other things but still the problem persists.
In my case, a fresh install of Android Studio resulted in Android 31 being the only SDK available but the project was targeting Android 30. I went to Tools > SDK Manager and made sure the appropriate version of Android SDK was installed and available. After restarting, and allowing the gradle sync to complete I was able to build/run the app on a virtual device, etc.
Here is what I found
This is the screenshot thanks for helping.
Capacitor lets you manage your own Android project. Like any IDE-backed project, sometimes things get so out of sync that the only solution is to rebuild the project.
To do this, follow these steps:
Copy any source code you created (such as Java files in app/android/src, manifest files, or resource files) into a safe location outside of app/android.
Next, make sure you are running an updated version of the Capacitor CLI:
npm install #capacitor/cli#latest
Remove the android directory:
rm -rf android/
Re-create the Android app from Capacitor:
npx cap add android
Copy your saved source files back into the project.
Check the error log. You should find something like "Module: 'mobile' platform 'android-30' not found" or something similar. Click Tools > SDK Manager and download the appropriate Android SDK Platform package.
on top right you will see option to view log file upon clicking there you will redirect to file manager and open idea file there
example :
open idea file and scroll down you will see actual issue.
In my case android sdk 31 was not installed.
I installed android sdk 31 from File>Settings>Apprearance and behaviour>system settings>android sdk and install required android sdk and rebuild the project.
accord to my observation in most cases you get this error because you have not required sdk installed in your system.

Flutter "Entrypoint isn't within the current project." error on Android Studio

Flutter app runs on VS Code with Start Debugging & Run Without Debugging and also with terminal command "flutter run" .
However it runs on Android Stuido only with terminal command "flutter run".
When I try to run it on Android Studio, with the play button which triggers the build, I get this error :
"Entrypoint isn't within the current project."
Invalidate Caches and Restart, flutter clean, quitting and restarting Android Studio are some options I tired with no success at all.
Have any of you faced the same issue?
What can be the problem? And please the solution...
Thanks in advance,
Oz
Here's the image of Run Config :
Click on File-> Project Structure -> Module then add root folder of your project then it will detect its a flutter app and then build
It works for me, hope it will work for everyone.
Goto File -> Project Structure -> Module
Or
in edit configuration, just name it "main" and locate the location of 'main.dart' file in the Dart entrypoint text field.
Please take a look at the below screenshot.
Run/Debug Configuration screenshot

Cannot create flutter project or run flutter project in Android studio. (flutter works fine)

I'm getting into flutter so I followed the install doc on the website and had no issue, installed the flutter and dart plug-ins on both Android Studio and Intelli J. The flutter doctor -v command results in the following
But yet when I try to create a new flutter project in Android Studio a folder is created with the project name but it is empty and I get the following in the event button on the welcome screen.
Error creating project
Flutter create command was unsuccessful
So I decided to create the project manually in gitbash where the create command worked perfectly.
I opened the project in Android Studio and discovered another problem even with the emulator running or phone attached the devices section of the run ribbon displays no device and always says loading in the dropdown when clicked.
So again I opened gitbash and in the project root folder type flutter run and the default flutter test app appeared on the emulator.
In Summary, Android studio can open but not create the project nor can it run it but the project can be run from gitbash on the emulator I launched from Android studio.
BTW: IntelliJ has a similar result when creating a project.
I have no idea what was causing the issue but a fresh install of Git seems to have resolved the issues.

I cant create new project in android studio

I installed android studio and when I tried to open the android studio I cant run android emulator and It display the error report in below tab.
This is that error message
null value in entry:libOutputDir=null
and line down display the Build Failed
This maybe a gradle bug. Delete the gradle folder in the root directory of your application. Then open the app, let the studio rebuild the gradle again. This has been an issue for a lot of people.

Trying to run App in Android studio 1.4.1 and having build problems

Go to run my app and i get the following errors in the log.
Error:Could not run build action using Gradle installation 'C:\Program Files\Android\Android Studio\gradle\gradle-2.4'.
Log states the following "Gradle sync failed: Could not run build action using Gradle installation 'C:\Program Files\Android\Android Studio\gradle\gradle-2.4'.
Consult IDE log for more details (Help | Show Log)"
Would anyone kindly tell me how to rectify this problem.
There are two options for you
option 1-update the gradle:
i-Get latest version supported by Android Studio from: http://www.gradle.org/downloads
ii-Extract the gradle file and install to dists folder(gradle folder): default location is: C:\Users[username]\gradle\wrapper\dists
iii-Open Android Studio: File/Settings/Gradle/Service directory path: (Change to folder you set above) and Click ok.
iv-restart Android Studio.
Option 2-Delete the .gradle folder:
default location is:
C:\Users[username]\gradle\wrapper\dists
after that open Android Studio and make a new project (might need to restart).

Resources