Android Eclipse Proguard fail - can't build project, no R.java generated - android

Ok, new to Android development. I'm using eclipse and starting a new project in accordance with the Android tutorials. When I create the project it says: proguard.cfg no such file or directory and the gen folder is empty, and the project has no default.properties.
Some suggestions say that the proguard thing can be solved by modifying default.properties but as I say this is not there in the project to begin with.
Others say to regenerate R.java I should delete the gen folder and rebuild (or do a clean). This does nothing. I am going mad trying to get this to work. I'm trying to build against 2.1 (SDK 7)
Any help greatly appreciated.

If problem still persist..
Just reinstall JAVA and ANDROID in the root directory instead of under their default paths in program files.

Clean install of Android SDK helped me with same problem. Downloaded starter package, extracted to different (than existing one) directory, changed SDK directory to new one and redownloaded everything - problem solved!

Related

I have encountered these errors in android studio?

I've recently started working with android studio and encountered these errors:
Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-6.7.1-bin.zip'
Missing essential plugin: org.jetbrains.android
I have tried different things to resolve these errors, like reinstalling Android studio from scratch. Any way to tackle these errors?
Delete the following file and retry
C:\Users\YOUR_USER\AppData\Roaming\Google\AndroidStudio4.2\disabled_plugins.txt
For MacOS users, the file is located in
~/Library/Application Support/Google/AndroidStudio4.2
Installing Android Studio is a messy thing in windows. Multiple modules are installed in multiple folders in cdrive.
So, removing android studio completely is a messy thing.
For the 1st error, you can download the respective gradle zip file and save it in .gradle folder inside C:/Users/username/. But this will not work with newer android versions.
For the 2nd error, you should delete a file named 'disabled_plugins.txt' which will be found inside C:/Users/username/AppData/Roaming/Google/AndroidStudioxyz.v
The same file is also found in Local/Google/AndroidStudioxyz.v also.
So, deleting these files will solve this error.
But, a better way to resolve both the errors is to remove and reinstall Android studio from scratch.
To remove android studio, make sure to remove any folder having the name Android in the following folders:
C:/Users/username/. Here delete .android & .gradle folders. Do not delete AndroidStudioProjects folder, because your projects will be deleted.
C:/Users/username/AppData/Roaming/Google/.
C:/Users/username/AppData/Local/Google/
C:/Program Files/Android
C:/Microsoft/ not must to delete.
Now install your android studio again.
Thank you!

accidently deleted R.java by using clean by ecclipse how do i regenerate R.java back

My R.Java was not updating properly, thats what I thought, so I cleaned the code and builded it but it resaulted the R.java file to be deleted. How do I regenerate the file back im kinda lost.
Just refresh the project / do build / rebuild project.
If that doesn't work try deleting all the gen tree in your project.
If that doesn't work try closing eclipe and reopen.
rebuild option under Project > Clean and then select the project you want to clean up... that's all
make sure that Build Automatically is marked, or if not then select the build project.
R.java is a generated file, once you do one of those, it will create the R.java for you.
I'll throw an additional thing to check. All of the answers here are traditionally correct. If you've upgraded to SDK r22 there's a new one. Go in to your SDK manager and make sure that you have installed:
Android SDK Tools
Android SDK Platform-tools
Android SDK Build-tools
I was able to figure this out after finally reverting back to using ant to do the build.
Another old issue that can cause you to have problems is an error in one of your XML files. If the res directory or any of the files in there or your manifest have a red error marker, fix the error there and then try doing a project clean/rebuild.

Eclipse giving error, missing R.java file after recent update

I have updated my SDK and ADT to the latest version, I have also update the Eclipse to Kepler the latest one after Juno.
My ADT version is 22.0. After this update when I create a new project, I'm getting error, stating R cannot be resolved to a variable. I have imported import android.R;, but it is showing as unused import stating Don't include android.R here; use a fully qualified name for each usage instead.
Same thing is happening with Mac OS also with the latest update. I have tried renaming activity_main.xml to other name, but still my R.java is not generated.
Tried all the things which are possible. Cleaned the project, build the whole workspace. Nothing helping.
I think ADT or Eclipse compatibility is having problem after the update.
I have updated my whole SDK, here is the screenshot, but same problem is there.
After updating to SDK Tools to rev. 22 for the first time, you may need to relaunch Android SDK Manager again and install a new item: Android SDK Build-tools.
After installing this, clean your projects and rebuild.
Yesterday, I made an update with sdk manager, and I had the same problem as you. I fixed the issue: I have updated another time the android sdk (with the sdk manager tool), then I check update from eclipse for install the updated ADT plugin and I rebuid my project. "Android sdk Build-tools" from Android sdk manager is now rev 17 and now it is OK. I think the issue is from adt plugin from eclipse
import android.R - remove this statement from all your classes and then do a clean your R file will be generated. if this did not work then check all your xml files for any errors and then do a clean. These 2 are the most common reasons for R file to go missing
Changes in your Build target also can effect R.java in Eclipse so
Right Click Project >> Properties >> Android >> Select Latest(usually) Android API Platform >> Click OK
Hope this is helpful.
Follow These steps...
Right Click Your Project.
Select Properties->Android Check Project Build Target and API Level.
Again come back and open Android Sdk Manager Chekc the Tools and make sure you are installed Curresponding Android SDK Build Tools.
Eg : IF you selected api level 17 in properties you should install Android SDK Build Tools 17..
Try this:
make a backup of your projects on desktop
close eclipse
delete your workspace
restart eclipse and import your projects again.
I had same problem.. I solved by doing the following:
check all xml files and drawable files if there are any CAPITAL LETTERS in file name, if you have then change it to lower case, if you are using selector xml files then check the other files you are linking in those files..all should be lower case.
Go to java files which show error and remove IMPORT R.java file from imports list.
Go to Projects>>Clean.
This should fix the problem. This is how i fixed :)
My issue was that I had android:orientation misspelled in my activity_main.xml file and I was getting this error. I fixed the spelling and problem went away! So make sure activity_main.xml doesn't have any errors in it.
Sometimes when you extract your file it miss some part so better when its extracting make sure all file are extracting properly and then run eclipse after that run a simple file and install plugin of avd
it helped in my case
if the problem persists then try closing the other projects by
right click -> close Unrelated projects !
this worked in my case
For eclipse users:
Comment the lines including R.*
Clean and build.
R.java will be generated and then uncomment the R.* and rebuild.
the best solution for r.java missing for linux...
R.java is self generated in gen folder.. so better dont edit or create manually by urself ..
-open terminal(alt + ctrl + t)
-change directory to skd->tools
-then provide executive attribute to all executable file by(sudo chmod +x filename)
-do the same for files in sdk->platform tools .. (ie sudo chmod +x filename) ..
-----every executable file sud b provided with +x attribute...
just delete gen folder all of your error will be cleared
Proven successful method, check the file (AndroidManifest.xml) and delete all comments in it, and make sure there are no errors in this file, I tried and did work with me.

Android Studio build error or misconfigured

I am having trouble building with Android Studio on one of my computers. The same project was building fine and when I pushed to github and pulled from the other machine I get the following error
Argument 0 for #NotNull parameter of com/intellij/execution/configurations/GeneralCommandLine.setExePath must not be null
I tried generating a new default project and I get the same build error so it must be something with my setup.
Does anyone know what I can do to fix these issues? Or even how to completely uninstall Android Studio and start fresh? Thanks
I had same error. In my case it was caused because of modification some important configuration. I fixed the issue by executing following steps:
File -> Other Settings -> Default Project Structure
SDKs
Add new SDK (select JDK option)
Specify path to JDK (in my case it was "C:\Program Files\Java\jdk1.7.0_45")
Save changes
You can also check if you have configured path tho the Android SDK
Good luck!
Had the same problem. Had to uninstall Android Studio, delete all files related to it including install files, the .AndroidStudioPreview folder under your user directory, and those files made in your project's folder upon importing. This amounts to the idea folder and the [projectname].iml file. Now reinstall and re-import the project. You can reuse the same build.gradle. Mine's working now.

Eclipse Upgrade Not Working

My Eclipse out of the blue stopped building my Android so I removed the old version and have installed Indigo. When I try to import an Android project in I get this error:
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException
Errors running builder 'Android Pre Compiler' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException
Errors running builder 'Java Builder' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException
Please help!
Try removing the .metadata folder from your workspace. This holds all your configurations, even after a new install. I think if you just delete this folder, assuming everything is in place, you should be up and running again.
The 21.0.1 version of the Eclipse ADT tools has a bug that prevents a project building if you have any files without extensions in them. This is a particular problem for users (like me) using subversion which has extenion-less files.
The solution is to install the 21.1 preview version of the ADT tools and SDK manager from Google. Clear instructions can be found here and you can read all the background add your voice to the angry mob of developers here.
This happened to me today with ADT v21.0.1-543035 and it turned out to be the .svn directories throughout the directory structure. See http://code.google.com/p/android/issues/detail?id=42051
Worked around the issue by upgrading svn client and working copy to 1.7.
For me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. It's not an Android project, but for some reason the newer version of the SDK somehow expects the file there. To fix the problem, I just copied a project.properties file from an Android project to the host unit test project.
I had something similar. The problem was created by having some files without extension inside the /src folder.
In my case, a branch tool, changed the encode of the file project.properties, I changed the encode to Windows-1265 and the problem was solved.
I had the same issue and fixed it by following comment number 6 in this page:
Issue 42051: Subversion folder causes NPE in PreCompilerBuilder
Let me quote the comment:
Solved it by installing subversion support packages for eclipse:
http://gan.so/VgYT
It's still a bug but...
same problem here, I closed Eclipse, manually removed any files in folder gen for the project, started Eclipse again, and made a build.
For also me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. I added it and problem got fixed.
I found the solution on this website(https://code.google.com/p/android/issues/detail?id=68755)
So basically, what we should do is :
Bring up $ADT_DIR/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini in an editor. Before the -vmargs line, insert these two lines:
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java
you can find the eclipse.ini following this
(On a Mac OS X system, you can find eclipse.ini by right-clicking (or Ctrl+click) on the Eclipse executable in Finder, choose Show Package Contents, and then locate eclipse.ini in the MacOS folder under Contents)
Upgrades did not work for me (on Linux), so I just installed IntelliJ Idea (build 123.155). Had to modify idea.sh to set JDK_HOME=/usr/lib/jvm/jdk1.7.0 (the Oracle JDK) and to select [menu] -- Run -- Run... -- Edit Configurations... -- Target Device -- USB device to make it work with the real device.

Categories

Resources