resources.ap_ does not generate when compile my android project - android

When i run my project its give me below error.
Compile Error: Error generating final archive: java.io.FileNotFoundException: ..\bin\resources.ap_ does not exist.
I tried to clean my project but also it can not generate the resource.ap_ file and my apk file size is 0..
please help me to solve this problem...

Quite often problems like this can be solved by deleting the project from your eclipse workspace (NOT deleting the project files) then importing the project back into the workspace. Give it a try...

Usually the following steps work:
ADT -> Project -> Clean

Related

update failed java.io.FileNotFoundException

i updated my ide to letest version after update i opend project on which i was working before update but it gave error but when i opend other projects there had no error
please help Thank you
update failed for AnAction(com.intellij.execution.ExecutorRegistryImpl$ExecutorAction) with ID=Run
java.io.FileNotFoundException: E:\Android\WhatsApp\app\build\intermediates\apk_ide_redirect_file\debug\..\..\apk\debug\output-metadata.json (The system cannot find the file specified)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileReader.<init>(FileReader.java:75)
just clean project and make a build
It is solved by just rebuild project
Build → Rebuild project
Workaround: if you encounter this error generating an APK, first clean the project (Build -> Clean project)
Open your project.
If your project files are not loaded and instead you see: 'Loading...' cancel Sync Gradle by clicking on X at the bottom, this should show your files back.
Clean Project: Build -> Clean Project
Rebuild Project: Build -> Rebuild Project
In my case, I was unable to Clean Project as well as Sync Gradle Files, So
Eventually I was about to give up, but then I went to
AndroidStudioProjects/project_name/app/build/intermediates/apk_ide_redirect_file/debug in the file explorer and found a file named redirect
That file contained the following information
#- File Locator -
listingFile=../../apk/debug/output-metadata.json
From here, I tried to locate the path mentioned in this file and I was unable to find itSo I searched output-metadata in the file explorer from AndroidStudioProjects/project_name and I found a bunch of output-metadata files, I copied the first one and pasted it in the mentioned location, and then everything worked perfectly
Now I don't know wether this is the right way to solve this or not, but it worked...
Hope it helps you...

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.

How to copy projects in Android Studio?

I tried copying my Android Studio project but every time I do that it gives me errors. I read other questions and answers on this topics but none of this helped me.
When I copy a project and try to run it on the emulator it gives the following error:
"Installation failed with message Invalid File:
C:...\app\build\intermediates\split-apk\debug\slices\slice_9.apk. It
is possible that this issue is resolved by uninstalling an existing
version of the apk if it is present, and then re-installing."
According to answers on similar questions, it should help to perform a 'clean project'. When I do this, the emulator starts but stops starting the app with a runtime error:
"java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{nl.assortimens.hardlooptrainingapp/nl.assortimens.hardlooptrainingapp.MainMenuActivity}:
java.lang.ClassNotFoundException: Didn't find class
"nl.assortimens.hardlooptrainingapp.MainMenuActivity" on path:
DexPathList[[zip file
"/data/app/nl.assortimens.hardlooptrainingapp-1/base.apk"],nativeLibraryDirectories=[/data/app/nl.assortimens.hardlooptrainingapp-1/lib/x86,
/vendor/lib, /system/lib]]"
How can I copy projects without errors or what should I do to fix those errors?
try to delete the intermediates folder and rebuild the project, if not delete the build folder and rebuild again
go to run-> rebuild project and should work correct
Try to remove the build.gradle file, and settings.gradle file. Then rebuild. Hope this gives your problem.

R java File missing

I recently added "recyclerview" dependency in my project and synced it.After syncing i found my R.java file missing. Now android is not showing support for R statements in the project.Please tell me how to fix this.
Sometimes, do a "clean" on your project will also fix this.
Eclipse: Project -> Clean, then rebuild your project
Android Studio: Build-> Clean, then Build -> Rebuild Project
Well Relax here is a Trick
Comment Every-line in .java File where your Using R reference,then Build your Project,It Will Rebuild R File,Now Uncomment then and you're good to go
i just copies the R file from another project.

Conversion to Dalvik format failed with error 1 :- No solution works

I am adding admob external jar in my project and i am using andengine as a library project but when i try to export the project i get this error. Also adding andengine library project adds andengine.jar also in android dependencies. Is that suppose to happen?
I have tried almost all other answers on stackoverflow but nothing seems to work.
If anyone can help me pls?
Following is my project image
Just solved this problem. I updated my sdk to latest and that solved the problem!
Try exit eclipse, backup if you want, delete gen and bin folders. Start eclipse again, build then export.
This usually happens to me after either eclipse has been running for a long time or after I have build a signed apk successfully. To fix it I just restart eclipse.
In Eclipse, select the project causing the error- go to the menu project -> properties -> java build path -> libraries and remove all jars including the android jars.
Then, right click the project, go to android tools -> fix project properties. Then, add back any other external jars you wanted to add to the build path following the same menu project -> properties -> java build path -> libraries. To ensure there are no errors due to missing libraries.
Then, do a 'clean' on menu project and build again. It should work.

Categories

Resources