I have an existing flutter app. I cannot see the android folder in the project. It is there in the directory and in Git. One of the problems is that when I commit my changes through the built in version control, Idea does not see my changes and does not commit them.
How do I include the android folder?
I am quite new to Idea
This question already has answers here:
What should be in my .gitignore for an Android Studio project?
(31 answers)
Closed 3 years ago.
Scenario:
I'm working through the exercises in an Android programming book.
I finish "Chapter 10", so I "Close Project" and exit Android Studio, manually delete build/* and copy "chap10" to a new folder, "chap11".
I start Android Studio > Open Existing Project > chap11.
So far, so good. Everything looks fine.
I start editing a .java source file or .xml layout file in chap11 ... and Android Studio overwrites the old files in the old directory instead (?!?)
Q: What causes this behavior?
Q: What can I do to make Android Studio "forget" everything about the old "chap10", and use ONLY filepaths from the new "chap11" instead?
I'm using Android Studio 3.5, Build: Aug 8, 2019.
I found the answer here. After copying the directory, I delete all of the following (and let Android Studio recreate them on gradle build):
https://stackoverflow.com/a/24679853/421195
app/build/*
.gradle/*
.idea/*
*.iml
local.properties
I think almost everyone agrees about /build.
I got sick of constantly seeing messages about the various library.xml
files that Gradle creates or deletes in /.idea. The build.gradle will
run on the developers's local when they first check out the project,
so why do those XML files need to be versioned? Android Studio will
also generate the rest of /.idea when a developer creates a project
using Check out from Version Control, so why does anything in that
folder need to be versioned?
If the *.iml is versioned a new user will have to name the project
exactly the same as it was when committed. Since this is also a
generated file, why version it in the first place?
The local.properties files points to an absolute path on the file
system for the SDK, so it definitely shouldn't be versioned.
I'm trying to put my Android Studio project on Github for backing up purposes, and for some reason I can't add the files under com.thing.otherthing to the commit. I can back up the layout files, the gradle stuff, and the built apk, but when I try to add the actual source code it reads "com.thing.otherthing" as one directory and does not copy any of the .java files inside to the Github repo.
Anything I'm doing wrong here?
I have tried to clone the following repository on GitHub using Android Studio, https://github.com/AlexKang/favr.git, but I have the error:
Before this I selected build project using Gradle and then accepted anything it wanted to install. I am having similar problems with, https://github.com/mb16/RemindEm.git, where I get that
Each time I selected "create project from existing sources" and then accepted everything it suggested.
What am I doing wrong?
The projects have eclipse .classpath files in the folder. I'm guessing you should be able to import the project into eclipse.
As an alternative to using Eclipse you might want to try using a feature of IntelliJ IDEA (Android Studio's parent project). File > New > Project from Existing Sources... Then select the .project file for the import
I am teaching android app programming at a highschool. I found Eclipse to fragile so we are now trying out Android Studio. But a couple of students get that Android Studio with R. in red font, showing that it is not recognized.
This happened for example when the student copied the contents of my files.
It sometimes happens when you open a proyect from other sources. Just Synchronize it or press Ctrl-Alt-Y.
R.java file issues : 1) check the naming convention of images in drawable folder with size.
2) check the style of your application
In your case it may be missing style .. So upadate the style in value folder as per application .
The most common reason for this error is bad XML coding. For example using android:src="#drawable#drawable/picture" in ImageView will give you R error as it will not let R.Java file to build. Its hard to trace such errors as XML file will not show any error.
Also take a look if your resources are of good quality!
Hope it helps! Cheers
Build -> Clean Project
Tools -> Android -> Sync Project with Gradle Files
and all OK!
Try adding the following:
android.enableAapt2=false
to gradle.properties and Refresh:
You can also do the following: Clean Project and Sync Project with Gradle Files.
try importing your project :
To migrate existing Android projects, simply import them using Android Studio:
In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
Click Import Non-Android Studio project.
Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.
In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)
Android Studio properly updates the project structure and creates the appropriate Gradle build file.
First if the existing project was developed in eclipse you need to import the project and then check what are the error. If your students are coping codes from your project then after coping the codes they need to clean and sync the project. If still your problem not solved try this in android studio :-
File/invalidate caches/restart.
Hope it helps you :)
Especially, for regeneration of R.Java file.
If you have tried all these options:
Clean Project
Rebuild Project
Invalidate Caches / Restart
deleted .gradle folder
deleted .idea folder
deleted app/build/generated folder
checked your xml files
checked your drawables and strings
and still face problem then check your classpath dependency in your Project Gradle Scripts and if it's, this:
classpath 'com.android.tools.build:gradle:3.3.2'
then downgrade it to, this:
classpath 'com.android.tools.build:gradle:3.2.1'
clean and rebuild it will sync your project.
I had the same issue, and the lint gave me a hand...
If you're using lint, it can help too.
In gradle.build(Module:app) add the lintOptions sub-element in android element as shown below, then lint will fix it for you!!.
android {
lintOptions {
abortOnError false
}
}
I hope it helps!!