Failed to create BuildConfig class-Android - android

I updated the SDK to SDK-18 and ADT to 22 version my current project shows
FAILED TO CREATE BUILDCONFIG CLASS Im working as normal user.
If i open the same workspace as administrator it works good.
i tried
projcet->clean
android tools->fix project setup
Window->preference->Java->build path->changed folders to project
I tried to create new workspace and import the same project got same problem
Help me to solve this issue

I solved the problem by delete the file under bin/ and gen/ directory. I think it is the permission problem. Check your project directory and make sure you have admin right.

After I imported the sample project from CD. I got the same error message. It is a permission problem. I did the following steps:
close project in ADT
change the directory and subdirectory permission in workspace.
Then, the error message gone.

Do the following steps
Delete the bin folder
Restart eclipse
Clean and run the project

Chanage Permission of your project directory to 777. Because of read only permission eclipse not able to write new files in bin folder.

Related

How to solve Specified AAPT2 executable does not exist on Android Studio 3.2

I've an issue with Android Studio. I'm trying to use it on Windows but I've trouble during the project's build process.
First, notice Android Studio is installed on my secondary HDD.
When I try to build/run my project I get this error:
Specified AAPT2 executable does not exist:
C:\Users\Rémi\\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\35960bdffa2420a45dff6ec260c07fa9\aapt2-3.2.0-4818971-windows\aapt2.exe
And indeed there is no aapt2.exe here.
But I've found this .exe here:
H:\Logiciels\AndroidStudioSDK\build-tools\28.0.2\aapt2.exe
and a previous version here:
H:\Logiciels\AndroidStudioSDK\build-tools\27.0.3\aapt2.exe
I've tried to fix this issue by changing the build tools version by setting File > Project structure > Modules > App > Build Tools Version. This option was empty and I chose 28.0.2 but that doesn't change anything.
Thanks for reading.
P.S.: This question is not the same. My error is different and I have google() in my Grable file.
I solved it by deleting the directory under which it expected the aapt2 executable, e.g. C:\Users\support\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\4c1f5b7dca1d5d378360be7f3fd9726a\aapt2-3.2.1-4818971-windows and then did a clean in Android Studio Build>Clean Project.
Afterwards it appears to have downloaded this again, with the missing executable, and now works perfectly.
I had the same issue. I resolved it by opening my file browser and navigating to this folder
C:\Users\(My User Name)\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar
Opening this folder and viewing its contents, I deleted the folder labeled 81c3666e327fa931c773a52e6cb0b3b7 which for you would be 35960bdffa2420a45dff6ec260c07fa9.
After this I went back to Android Studio and clicked the Build menu, and used the Clean Project option, followed by the Rebuild Project option.
I no longer get this error, or all the debug errors that say the Java package "R" did not exist.
I hope this helps.
Following solved my issue
under jar folder there are 3 folders, one of the folder consists of the aapt2.exe in it.
I copied that file to other folder where I am getting error.
ex:
path of jar: C:\Users\umabhavania\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar
error path: C:\Users\umabhavania\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\a57a698502c21bfe8cfc3ed6eb102b39\aapt2-3.2.1-4818971-windows
copied aapt2.exe file from 57f15fb82085ec9389484ff7e041344f folder to a57a698502c21bfe8cfc3ed6eb102b39
Hope this helps..
I resolved this issue by removing that folder
Go to that path -> Delete
Ex: C:\Users\Rémi.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\35960bdffa2420a45dff6ec260c07fa9\aapt2-3.2.0-4818971-windows\aapt2.exe
In this go to "C:\Users\Rémi.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\" and delete 35960bdffa2420a45dff6ec260c07fa9
Clean Project and Build
1- enter to the file like
C:\Users\4khalil\.gradle\caches\transforms-1\files-1.1\aapt2-3.3.2-5309881-windows.jar\6abc6a09978228d11497e7ca9c3de2c9\aapt2-3.3.2-5309881-windows
then if you find aapt2.exe.dat, delete the extension .dat to be aapt2.exe
and the problem will be solved.
You can use 'invalidate cache and restart'.
In Android Studio, go to File menu -> click Invalidate Caches/Restart.
Just chnage the gradle version in your build.gradle file in android folder.
For example mine was 4.1.0, changed it to 4.1.1
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
just copy paste this file aap2.exe get it from a friend or somewhere at this location and paste it on the same folder found in yours in .gradle C:\Users\Dina.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\8735df2342ae4ae127451389faa5e1f1\aapt2-3.2.1-4818971-windows\
then build and then the build will complete successful.
I didn't know how to attach the file in my answer I am new to stack overflow.

After update android studio - fail to create new project

After updating my Android studio today I created simple project and I got following error that.
Error:Could not set process working directory to 'E:\DevelopAndroid\myNewProject': could not set current directory (errno 5)
The 'E:\DevelopAndroid\' is exist and the 'myNewProject' folder created.
But still I can't upload the code to my Git server.
I am not able debug it.
And I don't know what to do.
Renaming directory without space
delete .idea folder
Restart Android Studio
It will work
close current project, delete it and create a new same project, it works for me.
under your project-> look a folder(.idea) delete everything in it. then go to file-> select sync project with gradle files click and let your project sync again
I solve this by assigning full control permissions to the root directory in my Windows 10 machine. In my case cdm-webservice-v2 is the project directory.

There are unrecoverable errors which must be corrected first

I have ADT Eclipse Project and I want to just import that project in android studio.
But I got this error There are unrecoverable errors which must be corrected first.
The error is saying that your project depends on google_Play_Service_Lib and android studio is not able to find that dependency, but what android studio did is giving you the path where you can paste that library and then you will able to import that project.
first download google_service_lib from
https://github.com/aporter/coursera-android/tree/master/Examples/google-play-services_lib
or
https://github.com/MobileChromeApps/google-play-services
and now paste that in
E:\android\CFPEvents\cfp-android-user
now again import..
find project.properties
open it,
delete(No package)android.library.reference.1=../android-support-v7-appcompat
later,you need download the package.
link http://blog.csdn.net/wu_wxc/article/details/47091795
You need to add the
google_play_service_lib
in the folder
E:\android\CFPEvents\cfp-android-user
and re-import the project.
Above answers are right but it seems it is only the First Step on the way to solving this issue because I had faced the same issue.
So what can be done?
First Step
First download google_service_libary not only jar and now paste that in E:\android\CFPEvents\cfp-android-user(path of your project folder).
Second Step
Close your project
Back up your project
Delete the .idea folder in the root directory of the project
Delete all the .iml files in your project
Import your project in Android Studio, and in the dialog that prompts
you for a file, choose the build.gradle file.
After this you should be good to go.

Project has no project.properties file When creating a new Android Project

I just installed Eclipse on my Mac, I downloaded the bundle that provides Eclipse+SDK, I've also downloaded all the needed updates but when I create a new project I get the following error:
[2014-08-25 16:51:02 - provaApp] Project has no project.properties
file! Edit the project properties to set one.
I've tried everything found here on SO but none of the answers worked, I really have no idea on how to fix this. I've also deleted and downloaded Eclipse twice.
Edit: I get also the following error if I try to edit the properties of the Project by right-clicking on Project Root folder > properties > Android
If I try to set the project build target (in my case Android 4.4W) I can't because it doesn't save the changes.
What I know works is if you create a new blank project, copy that project.properties file into the existing project and it should work. Also try running a clean project sometimes helps, but very rarely.
It's a pain but luckily this happens rarely.
Try to create a project.properties file with this content:
target=android-19

Unable to open/import existing project into Eclipse

I'm a beginner at Android and there's an existing Android project I'd like to import into Eclipse.
From googling I found I should do this via File/Import/Existing project, which I did (there is a .project file in the root directory of the project I wish to open).
However after doing this Eclipse displayed an error message saying:
"ERROR: Unable to open class file C:\Users\ ..... \R.java: No such file or directory"
However the file R.java does exist at the location Eclipse is displaying in the error message.
Why does it think the file isn't there when it is?
How can I proceed to open the project?
TIA
I was able to import the project but after I cleaned the project I wasn't able to import the same project back to the same workspace. I think some files got deleted from the cleaning process.
I ended up changing the workspace directory and was able to get it working again.
Try to Clean your project and then Rebuild it. You could also try to manually delete the R.java file and Rebuild your project.

Categories

Resources