How to generate R.java manually on Linux platform - android

I am developing android application on Linux platform because i have to make a system.img with a application.
When adding a drawable resource and building the project with mm command, i met a below error.
"cannot find symbol
R.drawable.icon_send_type"
At above error, the icon_send_type is the added resource.
This error occurred because the mm command did not generate R.java.
So, I want to know how to generate R.java by a manual on Linux platform.

I solved the error that the R.java was not generated by mm command on linux platform.
The drawable resource's date was the problem.
I used a linux's touch command in res/drawable folder and i run the mm command, then R.java generated renewedly.

Try to remove the R.stamp file from your intermediates directory, like
out/target/common/obj/YOUR_APP_intermediates/src/R.stamp

Developing on Linux is no reason for not using the whole Eclipse IDE and the integration of all the tools that it brings you.
If you can't use Eclipse you can build your project with ant. If you create a project with the Android SDK there should be an ant file that helps you to build your project. I recommend reading this part of the documentation on how to work with other IDEs or without Eclipse.

I found tons of solutions about this problem, none worked.
My problem relied on Android SDK installation.
The ADT plugin for eclipse installed the SDK without the build tools, incredible but true.
So I brought to sight the Android sdk manager:
windows --> customize perspectives... --> command groups availability (I checked Android SDK and AVD manager)
After that I installed the build tools:
Window --> Android SDK manager (I checked the build tools for android)
Close and restart eclipse
Finally the CLEAN command worked

Related

Cordova gradle wrapper missing in android sdk

I'm on windows7 x64, installed today's latest stable release of android sdk studio (through android studio bundle, since it's shipped together now apparently). I have properly configured the environment variables as you'll see above.
This is what I get when issuing the following command
$ cordova build android
ANDROID_HOME=G:\installs\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: G:\installs\Android\sdk\tools\templates\gradle\wrapper
And indeed, the "templates" directory doesn't even exist in my sdk install.
I've already tried the suggestions (setting the right path, uninstall/reinstall) of this question here but nothing applies to my case, and I find that manually copying and pasting packages is not really a solution, since there's a package manager in place.
If anybody has an answer as of today's android install, would be very much appreciated.
If still not working then copy all file from gradle\wrapper from Android Studio installation folder
C:\Program Files\Android\Android
Studio\plugins\android\lib\templates\gradle\wrapper
and paste it in your Android SDK gradle\wrapper then run same command.
E:\android-sdk\tools\templates\gradle\wrapper
This is a known issue; see CB-12544. For now you'll need to downgrade.
I downloaded Android SDK r25 manually and placed templates folder inside Android/sdk/tools. This solved the issue for me.
You can get it from https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
For Windows:
https://developer.android.com/studio/index.html
Go to the section :"Get just the command line tools"
There is a link 'sdk-tools-darwin-3859397.zip' for Mac, Unfortunately that didn't have the templates folder with Gradle Wrapper. So for Mac users, i will suggest not to go for this zip.

From where do I import settings from previous version of Android Studio?

I was running Droidio (Android Studio) 0.6.1; from there I was not able to update to the newest version (a quantum leap to 0.8); I had to download it separately and install from Windows Explorer. But now the installation process is looking for old settings:
Where it seems to want to take me is here (to the Android folder, I reckon); this is what I see when I mash the "compressed ellipsis" (one dot) button:
...but I'm not sure that is really the right spot; Is it [not]? What is the precise name of the settings file I should be seeking?
UPDATE
I followed Gabriele's directive, and then I got this:
I chose "Use Android Studio's SDK"
And then I got this when trying to rebuild my project, "Error:Execution failed for task ':app:preBuild'. failed to find target android-19 : C:\Users\clay\AppData\Local\Android\android-studio1\sdk"
UPDATE 2
I then opened the SDK Manager and installed what was missing/out of date, and tried to build again.
I got the error, "Failed to refresh Gradle project 'Platypus' Error: Cause: failed to find target android-19: C:\users\clay\AppData\Local\Android\android-studio1\sdk Install missing platform and sync project
The "Install missing platform and sync project" part of the message is a link. I clicked it, accepted the License Agreement.
Once that finished, the build failed again with a similar message: "...failed to find Build Tools revision 19.1.0 Install Build Tools 19.1.0 and sync project"
Again, the "install..." jazz was a link; I clicked it, accepted, and installed...
The next problem child was, "Error:The project is using an unsupported version of the Android Gradle plug-in (0.11.2) Fix plug-in version and re-import project"
Acquiescing to the counsel of the wise old man in "Never Cry Wolf," I endeavored to persevere by clicking "Fix plug-in version and re-import project"
At which point I finally got a successful build.
UPDATE 3
I then ran the project, and it seemed to be running (it said so, and the red square was visible), but no emulator ever appeared.
I opened the AVD Manager, and the device had a warning icon (repairable). I clicked the "Repair" button; it seemed to work - the warning icon disappeared.
But then I got this:
It still won't display an emulator when I Run > Debug App...
It used to be (with Droidio 0.5* to 0.61) that the first time I ran, I would see this:
...and the Emulator would eventually come up; subsequent runs of the app, the Device would be listed at the top (under "Choose a Running Device") - no more, though - it is only at the bottom as shown in the scream shot above, even on subsequent runs of the app...
I reckon I should try "re-creating the AVD's weird, malformed config.ini" but don't savvy just what steps to take to accomplish that.
UPDATED 20/10/2022
If you are using Android Studio Dolphin | 2021.x.y you will find these folders:
in Windows should be in c:\user\yourname\AppData\Roaming\Google\AndroidStudioX.Y
in Linux should be in /home/yourname/.config/Google/AndroidStudioX.Y and /home/yourname/.local/share/Google/AndroidStudioX.Y
in Mac should be in ~/Library/Application Support/Google/AndroidStudio2021.X.Y
If you are using AndroidStudio Arctic Fox 2020.3 you will find these folders:
in Windows should be in c:\user\yourname\AppData\Roaming\Google\AndroidStudioX.Y
in Linux should be in /home/yourname/.config/Google/AndroidStudioX.Y and /home/yourname/.local/share/Google/AndroidStudioX.Y
in Mac should be in ~/Library/Application Support/Google/AndroidStudioX.Y
If you are using AndroidStudio 4.1/4.2 you will find these folders:
in Windows should be in c:\user\yourname\AppData\Roaming\Google\AndroidStudioX.Y
in Linux should be in /home/yourname/.config/Google/AndroidStudioX.Y and /home/yourname/.local/share/Google/AndroidStudioX.Y
in Mac should be in ~/Library/Application Support/Google/AndroidStudioX.Y
If you are using AndroidStudio 2.1-4.0 you will find these folders:
in Windows should be in c:\user\yourname\.AndroidStudioX.Y
in Linux should be in /home/yourname/.AndroidStudioX.Y
in Mac should be in ~/Library/Preferences/.AndroidStudioX.Y
If you are using AndroidStudio 2.0 you will find these folders:
in Windows should be in c:\user\yourname\.AndroidStudio2.0
in Linux should be in /home/yourname/.AndroidStudio2.0
in Mac should be in ~/Library/Preferences/.AndroidStudio2.0
If you are using AndroidStudio 1.5 you will find these folders:
in Windows should be in c:\user\yourname\.AndroidStudio1.5
in Linux should be in /home/yourname/.AndroidStudio1.5
in Mac should be in ~/Library/Preferences/.AndroidStudio1.5
If you are using .AndroidStudioPreview 1.4 you will find these folders:
in Windows should be in c:\user\yourname\.AndroidStudioPreview1.4
in Linux should be in /home/yourname/.AndroidStudioPreview1.4
in Mac should be in ~/Library/Preferences/.AndroidStudioPreview1.4
If you are using AndroidStudio 1.3 you will find these folders:
in Windows should be in c:\user\yourname\.AndroidStudio1.3
in Linux should be in /home/yourname/.AndroidStudio1.3
in Mac should be in ~/Library/Preferences/.AndroidStudio1.3
Your setting (with a Preview version):
in Windows should be in c:\user\yourname\.AndroidStudioPreview
in Linux should be in /home/yourname/.AndroidStudioPreview
in Mac should be in ~/Library/Preferences/AndroidStudioPreview
I used a method to trick the Android Studio to import settings from previous one without exporting the settings and it worked.
Just go to your previous .AndroidStudio\config folder, copy and paste them all to the new one (in my scenario I updated from 1.1 to 1.2 beta) .AndroidStudioPreview1.2
(For preventing any failure, please make a Rar file of your original config,
also, after it works, export it so you can import it if you need it)
Starting with Android Studio 0.8.0 (Beta) its now
/home/{username}/.AndroidStudioBeta
for a *nix environment
UPDATE:
Since Android Studio is now out of beta the settings can now be found in:
/home/{username}/.AndroidStudio
On mac Sierra, Android studio 2.3
/Users/[username]/Library/Preferences/AndroidStudio2.3/
On my Mac, using Android Studio 2.1, the directory is
~/Library/Preferences/AndroidStudio2.1/
that is, not a hidden dir.
For Linux and Android Studio 4.2+, the location is:
/home/[username]/.config/Google/AndroidStudio4.1
assuming you are upgrading from version 4.1.
Contrary to JetBrains' documentation, but according to Configure Android Studio, the configuration is currently under a "Google" folder:
Windows: %APPDATA%\Google\<product><version>
Mac: ~/Library/Application Support/Google/<product><version>
Linux: ~/.config/Google/<product><version>
That's where I found them (the Mac variant).
And in a *nix environment, this will probably be located at /home/[username]/.AndroidStudioPreview
for Android Studio 4.2, Google has moved it to %appdata%\Roaming\Google\AndroidStudioPreview4.2
There is a single point of reference for the location of the settings folder for all Jetbrains IDE's for all OS's:
https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs
2020.1 and above versions
2019.3.x and below versions
To migrate the settings look for the folder listed under Configuration directory

Eclipse stop generating R.java

Today, I update ADT to 22.0.1.v201305230001--685705, and found that Eclipse stopped generating R.java. I believed that it is problem of Eclipse, because I create a whole new clean android project, and I cannot even run it as android application. I cannot find any files under gen folder.
The version of Eclipse is 4.2.2, is there any way to solve it?
I try to use Eclipse 4.3 with the latest version ADT, but the problem is still there.
I had the same problem.
Open up the android SDK Manager, and install the new android build tools. Without this you will no longer be able to build anything.
For some reason they have seperated them, and a lot of people are not noticing.
Try deleting bin folder and clean the project..and In Eclipse, under the Project menu, is an option build automatically. That would help you build the R.java file everytime modifications are made. The Clean... option is also there under Project It seems to be a common issue with many different answers
Update android-sdk, I think sdk need Android SDK Build-tools. For update it follow some steps--
Go to Window->Android SDK Manager.
Update and Install all tools (Android SDK Tools, Android SDK Platform-tools,Android SDK Build-tools) which are in Tools folder.
Check the xml files of your layout whether they are properly saved with no error or not.
I have faced similar problem that suddenly R.java is disappeared and eclipse could not regenerate it after building SDK. I checked SDK manager and saw that Android SDK build tool is perfectly installed. Finally, I have noticed that there are some errors in xml files. After fixing and saving those, R.java generated automatically in my case.

ERROR: dump failed because no AndroidManifest.xml found

When I try to upload an application to Android Play store I get the following error:
ERROR: dump failed because no AndroidManifest.xml found
Steps that I took:
new HDD, install clean jre, jdk
download Android eclipse bundle - latest version today
make a new project, sample. simple hello world
sign it with the wizard, create a certificate etc.
try to upload it on the market...=ERROR!
I tried many combinations, different eclipse versions. Even to sign it manually. It doesn't work.
If I try to run aapt dump badging I get the same error.
Just write in the terminal
flutter clean
Just delete app.apk file from: /build/app/outputs/apk/app.apk.
Visual Studio will create a new correct app.apk file.
I dont know o 'why' of this.
I faced this problem using Visual Studio Code in a Flutter project and Im posting my solution because it can help others.
I just run 'Flutter Clean Project' and then I run the project.
All works again!
In my case the problem was with the filename: I accidentally (subconsciously) renamed it to .apk, when it should be .aab 🤦
following points are need to be taken care of while uploading file on
android market
"android:versionCode" attribute from AndroidManifest.xml is proper.
"android:versionName" attribute from AndroidManifest.xml is proper.
The package name is very unique,. Because all the apps on android market are separated by the package.
see all this is in place....
taken from while uploading file to android market error
I had this issue suddenly as well,
my solution was
flutter clean
flutter build apk
and it started working again
OPTION #1: Slow down an re-read every step. (Source).
Basic Setup for Signing.
Before you begin, make sure that the Keytool utility and Jarsigner
utility are available to the SDK build tools. Both of these tools are
available in the JDK. In most cases, you can tell the SDK build tools
how to find these utilities by setting your JAVA_HOME environment
variable so it references a suitable JDK. Alternatively, you can add
the JDK version of Keytool and Jarsigner to your PATH variable.
...
Eclipse Users
If you are developing in Eclipse/ADT (and have set up Keytool and
Jarsigner as described above in Basic Setup for Signing), signing in
debug mode is enabled by default. When you run or debug your
application, ADT signs the .apk file with the debug certificate, runs
zipalign on the package, then installs it on the selected emulator or
connected device. No specific action on your part is needed, provided
ADT has access to Keytool.
OPTION #2: Test the features required by your application with an unsigned '.apk'. (Source).
You can use the aapt tool, included in the Android SDK, to determine
how Google Play will filter your application, based on its declared
features and permissions. To do so, run aapt with the dump badging
command. This causes aapt to parse your application's manifest and
apply the same rules as used by Google Play to determine the features
that your application requires.
To use the tool, follow these steps:
First, build and export your application as an unsigned .apk. If you
are developing in Eclipse with ADT, right-click the project and select
Android Tools > Export Unsigned Application Package. Select a
destination filename and path and click OK. Next, locate the aapt
tool, if it is not already in your PATH. If you are using SDK Tools r8
or higher, you can find aapt in the /platform-tools/ directory.
Note: You must use the version of aapt that is provided for the latest
Platform-Tools component available. If you do not have the latest
Platform-Tools component, download it using the Android SDK Manager.
Run aapt using this syntax:
$ aapt dump badging <path_to_exported_.apk>
compile it & export the project under Linux (eclipse)
switch to InteliJ Studio (recommended)
It seems that from time to time there is a problem with eclipse under Windows 7,8.
flutter clean && flutter run
also works
I'm using VScode.
What happened:
After dart update, there was a permission error on flutter.bat
Solution:
Locate flutter.bat and give Full controll.
Open a cmd with Admin privileges, locate the folder that you are doing the development.
use 'FLutter clean' command (do not use vscode Terminal)
rerun app using 'Run without debug'
run flutter clean then flutter pub get. Then run your application, it should work
Error while run xamarin.uitest on using android sdk build tools 29.
Problem solved by changing android sdk build tools to 28.
I have same problem and solved by deleting all folders containing apk files in the location -
D:\FLUTTER\MY PROJECTS\SAMPLE\myapp\build\app\outputs.
if any folder is found access denied then force delete the folder or restart your system and try deleting the folder, then rebuild the app. It will work.
Go to the directory build/app/outputs/apk/debug , and the directory build/app/outputs/apk/flutter-apk . Erase the present files, once the compilation has run these files will rebuild and the error will disappear!

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