Can't find Android Size Analyzer in Android Studio - android-studio

According to https://developer.android.com/topic/performance/reduce-apk-size, I should be able to install Android Size Analyzer as a plugin, but nothing shows up.
Android Studio -> File -> Settings -> Plugin -> Marketplace -> search for "Android Size Analyzer"

UPDATE: 17th May 2022
After a lot of trials, errors & frustration, I was able to make it work. Here are the steps: (for MacOS)
Download the the plugin's zip folder from the Github https://github.com/android/size-analyzer/releases
Extract the zip and add the size-analyzer executable and the analyzer.jar to Users/<your_user>/Library/Android/platform-tools
(You can add the above files to any place but I bundled it with platform-tools because this location was already present in my $PATH variable. Wherever you place those two files, please make sure that this location is present in your $PATH variable else it won't work. Don't know how to set path variables? Please refer this https://techpp.com/2021/09/08/set-path-variable-in-macos-guide)
Now in your Android Studio Terminal, run the following command
size-analyzer check-project <your-path-to-project-directory>
(After above step, If the terminal complains like size-analyzer command not found, it means your $PATH variable is not set properly)
After analyzing the entire project, it shows output like this
The result analysis provides lots of suggestions and space saving options. Thank you Google for such amazing plugin : )
=================
OLD : 16th May 2022
The AS plugin Android Size Analyzer is deprecated! It's no more indexed on Plugin Market Place(You cannot install it directly from AS anymore).
I even tried installing the plugin from their GitHub Repo, but all in vain. When adding the plugin to studio from disk, the following error popped up.
Maybe you can try downgrading the studio and then install it.
Looks like, we'll be on our own for a while : (

Related

Plugin Error: FindBugs-IDEA -> How can I remove it?

since some weeks Android Studio shows me "Plugin Error" info. But I can't remove this plugin. I don't see it in the plugin list.
How can I remove it?
Look for the configuration files directory. On Linux you would have something like this
~/.local/share/Google/AndroidStudio4.1
You should find there a directory named
FindBugs-IDEA-1.0.1
Replace versions numbers with your own, delete the directory or JAR file.

Gradle Error: Path is not a readable directory for an Android Project saved in OneDrive

I tried to use a OneDrive folder to store my Flutter project [Windows 10, Android Studio]. I then made edits to it on another machine [same configurations]. The project compiled fine on the first machine initially and on the second one after the changes. Running it on the first machine again after the changes I get the below error:
Execution failed for task ':app:processDebugResources'.
Path "build/[package]/intermediaries/compiled_local_resources" is not a readable directory.
I've tried a number of solutions mentioned in similar, though not equivalent issues:
Updating Android Studio
Running Android Studio as Administrator
Removing the [package] from my dependencies (this resulted in a
different package being identified in the error message).
Pressing File -> Invalidate Caches / Restart...
Commenting out
"org.gradle.jvmargs=-Xmx1536M" in gradle.properties
Doing:
cd android
gradlew clean
None of this worked.
I had the same problem today:
Path "build/[package]/intermediaries/compiled_local_resources/debug/out" is not a readable directory.
I was able to fix this issue by deleting the .gradle and rebuilding the project.
All I did was create the (empty) directory that it was looking for and it built fine afterward.
mkdir -p compiled_local_resources/debug/out
I had the same issue, came out of no where and it really shouldn't make the build fail... but all I did was create the (empty) directory that it was looking for and it built fine afterwards.
In the end the only thing that worked for me was pushing the project up to a Git remote and cloning it from there into another (local) directory.
[not sure this counts as a solution but nothing else worked for me after a long agonising search so hopefully it helps someone]
I know the OP had Windows, but if it helps anyone else in the future:
On Mac OS I discovered (the hard way) that Android Studio and Flutter do not play nice with being stored in iCloud! I noticed that some files weren't available locally and that's what was causing the problem for me. I moved my project out of iCloud (forcing it to download the missing files forever) and then it was fine.
Deleting the android/.gradle folder worked for me.
+1 also to the #1 answer (Vadow). As I do not have 50 points yet was not able to add this as a comment, so will have to post separately.
Like the OP, I have two machines - and got into trouble (Synology Drive). Vadow's solution worked for me, but I also had to do:
Flutter Clean
Flutter Pub Get
on the terminal and from within the project directory to get things follow back up and running.
Thank you Stackoverflow, and thank you Vadow!

FBX Converter - Gear VR

This is a x-post from my question listed at https://answers.oculus.com/questions/583/fbx-converter-gear-vr.html
I'm attempting to use the Oculus FBX converter tool which came bundled with the Oculus Mobile SDK for Samsung Note 4 download.
Unfortunately, FBX Converter appears to be a Windows only tool :(, so I'm attempting to run this via Parallels Desktop.
There's a readme file in the tools dir which contains some instructions for downloading the AutoDesk FBX SDK and moving to an appropriate directory. I've followed them.
Inside the tools dir I see a makefile. Windows does make? Cool, so I attempt to make:
makefile(3) : fatal error U1033: syntax error : '=' unexpected Stop.
Huh... luckily there's a Visual Studio solution here. So I open the .sln and build. Dang, looks like I have to change the Platform Toolset to v110 because I have VS2012. Try again... Ahhh man, bunch of syntax errors about unexpected identifiers in std::max. I guess I'll try and fix it - std::max - expected an identifier
Cool, build is starting and..... ugh. cannot open file libfbxsdk.lib. Wait a second, I bet it's an issue with how the .sln is pulling in it's dependencies. Yup, wrong pathing. Add an extra ../ and here we go.... nope, no dice. cannot open include file fbxsdk.h.
So that's where I am right now. All I really want to do is convert an fbx file to a .ovrscene. Is that so much to ask? Is there a better way to do this? I hope so.
oh.... looks like there's a bin dir with the FBXConvert .exe included in the download. You'll have to add a .dll, to your System32 directory. That was awesome.

Installing Emacs Emulation keybindings -- Invalid VSIX package

I'm trying to install the extension for Visual Studio 2012 that allows emacs key-bindings.
I'm following through the steps here:
Emacs Keybindings in Visual Studio 2012 or 2013
I'm up to step 5:
Run the vsik file as administrator. This is required so the extension
can write Emacs.vsk into the program files folder. I wasn't sure the
best way to do this so I ran a command prompt as admin and then
executed start emacsemulations.vsik from the prompt.
So, running emacsemulations.vsix from an administrator command prompt,
I get the following error "This VSIX package is invalid because it does not contain the file extension.vsixmanifest at the root."
I'm not changing any of the file names inside the package.
I'm thinking this may have something to do with how windows zips up the file -- I'm able to recreate the problem simply by unzipping and rezipping the EmacsEmulation.vsix file without changing the contents of the vsix package.
If anyone has any suggestions on how to fix, or even better, the actual updated vsix file itself, I'd be very grateful!
The issue you have relies on the way you are zipping your file, what you should do is zip all files inside the folder you created (in this case, "EmacsEmulations") when you unzipped it.
Step into the EmacsEmulations folder.
Select all files.
Add to .zip
Rename the .zip output to EmacsEmulations.vsix
I'm trying to get this extension to work too, so good luck!

How to run NDK samples?

Sorry to ask such a noob question, but the NDK documentation is wrong (r7b):
If you are developing in Eclipse with ADT, use the New Project Wizard
to create a new Android project for each sample, using the "Import
from Existing Source" option and importing the source from
<ndk>/apps/<app_name>/project/. Then, set up an AVD, if necessary, and
build/run the application in the emulator.
There is no "apps" folder, and the samples do not contain a "project" folder. So ... what is the correct way to run a sample?
Also, can I configure Eclipse to build the C++ portion of the code automatically?
Click File | New | Project...
Choose Android project, Next
Project Name: This is the project name shown in Package Explorer. It is just a string stored in the .project file that Eclipse creates. No file or folder is created with this name, and the output binaries do not seem to contain this name.
Click "Create project from existing source"
Location: choose the project's root folder, e.g. .../android-ndk-r7b/samples/bitmap-plasma
Click Next and choose your target API. Eclipse does not seem to allow this to be changed later, at least not from the GUI. I don't know why Eclipse does not simply get this information from <uses-sdk> in AndroidManifest.xml or from the "target" line in default.properties. I also don't know why the two may be different (e.g. in the bitmap-plasma sample, target=android-9 but <uses-sdk android:minSdkVersion="8"/>.)
Click next and consider changing the "Package Name" field which defaults to "your.package.namespace". However, the project will run fine if you do not change this field. Leave "Create Activity" and "Create a Test Project" unchecked.
Click Finish. Eclipse will create numerous extra files (e.g. .classpath, .project, project.properties) and folders (bin, gen, assets) alongside the existing code. That's in addition to the output folders created by ndk-build (obj and libs).
Eclipse won't build the native code by itself, but it will automatically deploy the native code (e.g. libplasma.so) if it is aware of it. After you build the native code on the command line, e.g.:
C:\...\android-ndk-r7b\samples\bitmap-plasma>..\..\ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup : libs/armeabi-v7a/gdb.setup
"Compile thumb : plasma <= plasma.c
SharedLibrary : libplasma.so
Install : libplasma.so => libs/armeabi/libplasma.so
"Compile thumb : plasma <= plasma.c
SharedLibrary : libplasma.so
Install : libplasma.so => libs/armeabi-v7a/libplasma.so
Right-click your project and choose "Refresh", otherwise Eclipse might fail to upload the native code when it starts the emulator.
Finally, to run the sample, right-click the project and choose Run As | Android application. See here about choosing which emulator is used.
See here about configuring Eclipse to build the native code automatically.
I am curious why NDK produces two *.so files with very different sizes for each ABI, e.g. it creates libs/armeabi-v7a/libplasma.so (15 KB) but also obj/local/armeabi-v7a/libplasma.so (63 KB). Anyone know the difference?
Instead of going the long winded way ( seasoned programmer love it - but for beginners). There is a way to build the native library in Eclipse and NDK.
1> First you need to make sure NDK path is correct in Windows -> Preference -> (tabs) Android -> NDK - If not set - point it to ndk directory.
2> Assuming you have you imported project as described above (New | Project | Create from existing code) - You right click the project and go to " Android Tools -> Add Native Support ..". If the path is set it will build the example. And then you can deploy it to the device or AVM by pressing the play button.
SOURCE
I'm working with Eclipse ADT and Android ndk 5b. My correct path to the project is android-ndk-5b/samples/project
When you import from existing source you have to choose a correct target, I use Android 2.3.3.
After, I've updated my project from command line, look this link, http://developer.android.com/sdk/ndk/overview.html
From the samples path write: android update project -p . -s and $Your_Path_Android_ndk/ndk-build
Finally, only run as android app in Eclipse and it's done
It seems that with Eclipse Juno, you can now
Click File | New | Project...
Under Android category select Android Project from Existing Code and click Next.
In Root Directory you can then browse and confirm your sample project location.
From here, Eclipse can automatically detect the jni and find the projects.
If this didn't work, go to terminal or command prompt and navigate to your project root directory (where you see jni folder). Then input
android update project -p . -t <your target level>
Here should be, e.g., android-9
After this, try again the initial steps.

Resources