I've been reversing an app, but came across a problem. The AndroidManifest.xml file is not writable.
I made sure that the file is not 'read-only' in file explorer, but it still doesn't work. And I can't find 'merged text tab(?)' sort of thing which is supposed to solve this.
Hey there can be multiple ways you can try to solve this issue:
The simplest one is to Clean and Rebuild the project.
You can go to your File -> Invalidate Caches and Restart.
Try running Android Studio in Administrator mode.
You can try this : https://stackoverflow.com/a/34705198/9062752
Let me know if any of these fixed your error.
Also note : Not sure about this library but I read a comment which says ".jar files cannot be edited", so yeah if you are trying to edit a .jar file it is not possible (I am not sure of the reason though)
dear please check your menifest file that you can show build version name and build version code in application class please remove it and check any error in your menifest file and than you can run or rebuild your project .
Related
Everything was fine. I just built it yesterday. Today, while I opened this most of my JAVA classes code, turned into xml. I don't know what kind of strange reason it is.
I tried 2 options below but nothing worked :
File > Sync project with Gradle files. Result: didn't solved my problem.
File > Invalidated cache/restart. Result: didn't solved my problem.
I attached a screenshot.
I found a solution that worked for me. Keep Android Studio open and go into the file system. Open every java source file and all xml files into some editor(Notepad++) and change something then save the file back to origin.
Now Android Studio detect all files as normal
Android studio: Click on malfunction file then Right-click -> Open in -> Explorer.
Choose your file where was the problem and open them with Notepad.
And change something, like adding the space and save it.
And Sometimes Android studio turns files into UTF8-BOM. It needs to change to UTF-8. You may do with NotePad++ -> Encoding.
my android studio gone crazy like this please help??
file was loaded in the wrong encoding: 'UTF-8' in android studio
An encoding issue can be solved by deleting all files contained in the Android Studio "caches" folder, which can be found in "C:\Users<username>.AndroidStudioX.Y\system\caches".
Make sure that to close Android Studio before deleting.
For people in future:
I had the same problem.
I was able to solve it simply by making a copy of the project and opened the copied project.
Copied project worked perfectly fine.
Note: I got this problem because of improper shutdown of my PC.
In my case it happend after Windows died with the blue screen, here's how I fixed it:
Close Android Studio
Find a directory named .AndroidStudioX.X in C:Users/YourUsername and rename it to old.AndroidStudioX.X
Restart Android Studio and choose the renamed old.AndroidStudioX.X to import settings from.
My answer is taken from here https://stackoverflow.com/a/53476487/4277741
On Windows close Android Studio and delete its cache directory:
c:\Users\[user name]\AppData\Local\Google\AndroidStudio[XXXX.X]\caches
you have to just delete the catches folder in C:/users/"your PC name"/AndroidStudio(version code).
Sometimes it gets disturbed because of some reasons like you have shut down the PC in improper way so it won't get enough time to shutDown all stuff So all that errors occurs.
I think it would definitely work for you.
Have a nice day!!!!
:)
All you need is to remove the Android Studio settings directory, which can be found:
on Windows
C:/Users/yourusername/.AndroidStudioX.Y
on Linux:
/home/yourusername/.AndroidStudioX.Y
Close Android Studio, delete the directory, then reopen Android-Studio and open your project.
Also if it happens on a different IDE, it is the same approach.
If the issue persists, try to copy the content of your project directory into a new directory, then open the project from the new directory.
This is an old one but I just click Invalidate Cache / Restart on file option in IDE and after restart, it works.
Version Android Studio v4.1
I had to replace unknown characters(which I had in a comment) into known ones. The issue happened after resolving merge conflicts.
This is an old issue, but if anyone comes across this, what isn't mentioned above, but happening for me is that the original file on disk is intact java code. Android Studio is reading it like this for some reason.
I had the same problem and how I fixed it is that I just went to the directory where the java files for my project are located, which in my case is users/user name/AndroidStudioProjects/Project name/app/src/main/java/com/example/android/project name, and here you will find all java codes you wrote for your project just open the one making the problem with notepad and you will find your code here in the right format and perfect just copy all of it and get back to Android Studio window and delete the wrong formatted code and paste this one and wait for it to sync and that's it. If you face the same issue with XML codes just do the same thing find the directory where XML files are located.
This worked for me, I clicked on utf-8 and code is displayed in proper format.
Just rename the project folder and reopen it in Android Studio, worked like a charm!
Invalidate Cache & Restart / Clean & Rebuild doesn't work for me. The project cache corrupted after improper s/m shutdown. Just change the project dir path renaming the project, it'll work.
That's not an encoding issue. That's compiled bytecode, the content of a .class file. You cannot simply rename it into .java and expect it to work.
I am having trouble setting up the build path of my java project. I am currently in a Co-Op IT position so I am somewhat new to all this. My background is mostly in C++ and I am learning java on the fly. I am also somewhat new to Eclipse (Kepler service release 1).
I am working on a bug on an existing program and need to get the program to build so I can work on it. When I add all of the external .jar files that I know for a fact are the right ones, I am getting this error on two of them :
"Archive for required library: '(location of file)' cannot be read or is not a valid ZIP file"
Two of the other full time guys on my team have gotten the program to run with those exact same .jar files, one running Eclipse Indigo and the other running the same Kepler version as myself. I also was able to open the two .jar files manually and everything appears to be there. After every trial trying to fix this, I have refreshed, cleaned and restarted eclipse. The two other full time guys said they have never seen this error. I would like to get some insight on this from anyone who has any similar experiences so that I don't have to use up much more of their time.
I Had this issue, just fixed by deleting .jar files from Libs directory then copy->paste original Jars again. Then do a complete clean -> rebuild
I got this problem, took help from following link solution
which basically says to
1. delete the corresponding maven download folder
2. maven>update project in eclipse
In my case I deleted hibernate folder, since i was getting error related to hibernate-validator.jar
I had the same error here. What I did to resolve the problem was close and reopen the project.
I got the same problem and found out the root cause is the JDK in my linux shell is set to 1.6, but in the eclipse, the JRE is 1.7.
Using Eclipse without m2e features (Standard Edition) helped me.
Similar problem with Spring toolsuite
Just came across this link that shows a way to get unblocked.
In preferences dialog box go to
Java->Compiler->Building
and change Incomplete build path to "Warning" (from default "Error")
This can be done globally (for all projects), or on a project by project basis.
Check the jar's file permissions/ownership.
I had the same issue on eclipse installed on Linux and fixed it by setting the file permissions right.
In my case ..worked after removing this from spirngrest-servlet.xml file.
<prop key="net.sf.ehcache.configurationResourceName">/Sysehcache.xml</prop>
I think it had to do with default location of maven repository of jar files.
Been at it for 3 days. finally solved it.Hope it helps anyone.Just look for similar think in your spirngrest-servlet.xml file. Good luck.
I just tried the following and it worked:
Close eclipse as there might be some files eclipse is accessing and you won't be able to delete.
Delete all the libraries installed in the maven repositories folder: ".m2/repository"
Open eclipse and update your project(Alt+F5).
What did we just do? : This is possible that the existing libraries in the local repository are erroneous and maven tries to open which it fails in. We have now deleted the already existing library and with the project update, Maven will download the library again which should resolve the issue.
i fixed this by just deleting everything inside of the /Users/username/.m2/repository folder. not the repository folder itself. and then running a mvn clean package in the project folder
I'm on Eclipse for hours now and I didn't found a solution yet for my problem even after many searches on internet: I have no more R.java file on my projects.
On just created or on my old projects, i don't have R file anymore and I tried so many solutions (uninstall, re-install Eclipse, clean my project, check all my XMLs, fix problem with android tool and so on ...)
Please someone can tell me what to do in this case?
Hey If you just updated to ADT Rev 22 :
I had the problem too. There is a new component in the Tools folder called "Android SDK Build-tools" that needs to be installed.
Step 1
Open the Android SDK Manager
Step 2
Select the newly added Build Tools and install. (If problem stays then go to Project Properties => Java Build Path => Order and Export and check Android Private Libraries, then clean and build project.
It may be necessary to repeat the process, restart the SDK Manager after the update and make sure it looks like this (all tools installed):
More info:https://groups.google.com/forum/?fromgroups=#!topic/android-developers/rCaeT3qckoE%5B1-25-false%5D
Perhaps in Project Properties -> Java Build Path -> Libraries you don't have:
Android 4.2.2 (or other version)
Android Dependencies ?
If so, then right click project - > Android tools -> fix android properties
and see if this library showed up.
Thank you all for saving me! I've spent the whole afternoon on search this error.
Finally, my project works.
By the way, I also encountered one problem which i wanna share with you:
After upgrading, even if my project has not errors anymore. During runtime, it seems it couldn't find the classes from the jars placed in \libs.
Go into Project=>properties => Java build path= > Order and Export.
Please make sure all your jars are checked.
If this problem occurs suddenly in a well working project,
the first step is to find whether the problem occurs only in the current project or in all other projects.
if all other projects in the current workspace are working then 90% problem is with XML / mainfestfile/resourse file that you edited recently.
This error is not shown as red mark we have to find out what we have done recently in these files.
try this
sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev
it solved my problem
Close your eclipse and after refreshing system, try to open Eclipse again. I think you are using Emulator along with the eclipse. It may be because of the low Memory problem (RAM) of your system. I used to face the same problem when I use Emulator
whenever there is any mistakes in any of the xmls the R goes missing when a build or clean happens so check for any xml errors in your project unless you fix it you cant get back your R on clean or build. fix the xml files and perform a clean you will have the R generated. Also check in File->properties->Builders and see if everything is checked
I was using Eclipse Indigo and nothing I tried worked. I ended up downloading Juno SR2, reinstalling the ADT, and now everything works again.
Reinstall everything and it'll work.. i.e. go back to Google SDK or w.e. you're using and download it.
Update it to latest in SDK Manager.
Go into Eclipse-Project-Prefs-Java build path-order/export TICK EVERYTHING.
problem: No R file get generated.
guess: Try cleaning project if it is old one. Else create new project with no R get generated and with no compile errors but this: no project.apk
In this case you have to check your SDK for the built-tools. May not be installed after updating SDK.
Thus download them if not download here, then put them under directory: SDK/built-tools folder. Lastly, and most important, is to Run the SDK As Administrator. This guarantees refreshing SDK with all packages appearing in it.
Install the SDK-Built-Tools or any missing packages according to the above link and you're done.
hope this helps.
Try one thing, create a new Android Project and transfer all those files which are in the previous project. That worked for me.
In my case there is error due to "&" inside strings.xml file(but error not shown) for declaring string for a array type. Now the problem has been solved as I changed "&" to "and".
So, please make sure that you do not have such silly use of symbols, and clean the project.
I have had the same kind of problem, however Rechecking all XML files in the Resources folder was helpful in my case. I found syntax error in my XML files. Cleaning and building the project again can be helpful sometimes too.
I had the dreaded not more R.java.
Some of the things I've used in the past:
Clean / rebuild (the first thing we all try)
Restart eclipse (optionally reboot pc/mac)
Update both SDK/ADT eclipse plugin to latest version
Create new eclipse workspace and import project
Enable Verbose AAPT build output Eclipse menu>Preferences>Android>Build
Port project to Android Studio / Gradle (this helped my actually see the AAPT error i was getting Error Code:138)
Delete recent XML changes - Ultimately I found deleting recent menu.xml files I'd added and commenting out where they were referenced fixed the issue and I finally got R.java.
I got the error recently and had found no fault in any layout or value file. After a lot of tries I add another Activity and the R.java was build and the error disappeared. I don't know why this occur, but it takes me hours.
For some reason, when i started up eclipse today, it couldn't find my main XML in my
setContentView(R.layout.main);
When i write R. it can only find "Layout - Android.R" - and not my "Layout - com.your.app"
Anyone who knows how to solve this problem?
I just realised my Java file in the /gen folder is missing, how do i retrieve it again?
Cleaning project doesn't work
You need to remove the import android.R statement at the top of the file.
See here for more information:
http://source.android.com/source/using-eclipse.html
Try Right click on project > android tools > Fix Project properties
Project > Clean
Project > Build Project
Option 1)Project > Android Tools > Fix Project Properties.
Clean and Rebuild your project.
Option 2) Refresh your project F5, Delete folders /gen and /bin then Rebuild your project
Option 3) update the build tools, some time this will cause a lot of problems and you will have the annoying message related to "Can't find R.layout"
But in this case you wil fix, delete because you donĀ“t need this:
import android.R;
i think this is your problem.
Folder /gen is automatically generated, but you will solve problems related to resources, probably something missing in your layouts, one of them will have a warning or error.
check you are importing the current R class, and enable Auto Build under project menu, if enabled, then use clean under the same menu to rebuild the R class
It can be that your project contains errors. To see list of resources it must be able to compile. After that your resources will apear.
I got the same problem with one of my project where I copied an existing XML file (say xmlfile) over.
Then, Java file cannot resolve R.layout.xmlfile.
I guess it is probably due to the end of line feed/CR compatibility between Windows and Linux.
so, I pruned all the LF/CR and re-saved it on my Mac machine.
Then, the problem is resolved.
Hi had same problem few minute ago. I kept looking and looking and finally i found out -- >
Its because i was using a file in drawable folder with
1-launch-screen.jpg (Invalid Name for drawable file)
Make sure your file name has valid.
It can not have any '-' character in drawable filename.
File name has to be all small letters only.
And that red X mark automatically disappeared and project started top built and i was able to see R.layout.MyNewLayout.
Hope this helps !