Exporting APK from eclipse (ADT) silently crashes - android

Every time I try to export an APK from Eclipse (tried Juno and Indigo) on Mac, eclipse crashes after a few seconds
This used to work fine on my current setup.
Running the app straight (debug mode) on my phone works fine.
The error from the console is:
Invalid memory access of location 0x10073f113 rip=0x101f656f7
Bus error: 10
I'm using Mac OS X 10.7.4 on a ~2010 MacBook Pro, with the following java:
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
I'm using ADT 20.
I've tried reinstalling Eclipse and the Android SDK, and re-downloading ADT.
The Eclipse error view doesn't show anything
Any ideas of different methods I can try, or other ways to investigate what's going wrong?
Cheers
Update: For anyone coming along post-2014, you should be using Android Studio, which doesn't have this problem.

Disable Project/Build Automatically when you are exporting
I think is a problem of Eclipse unable to detect the Android command is still working or something similar.
Of course there is ever the option of APK generation using Ant outside Eclipse you can generate an Ant build.xml from your Eclipse project more info in official Android docs

Disable Project->Build Automatically. I've noted that this works for me.

Disable project/build Automatically before export the apk.

This seem to be problem with your JVM. Can you update your java and check again. Also check this link

project/ clean worked for me. I think it could be related to the building of the project, as other users have posted.

The problem has gone until I have update ADT and Eclipse. I don't know which one solve the issue.
Now it's working smoothly for severeal signed export, with:
ADT Version: 22.2.1.v201309180102-833290
Eclipse Juno Service Release 2 Build id: 20130225-0426
Gentoo Linux running Java 1.7.0_45-b18.
UPDATE: Few exports after, I still get crashes from time to time, but no very frequently.

may be you should try to add execute authority . you can try something like this
first close auto-build
cd /home/your name/android-dev/sdk/tools/
sudo chmod +x zipalign
done and good luck to you

I used the disable Build Automatically for months now, until I realized that AWS plugins were slowing down the entire launch process. I uninstalled all AWS plugins from Help->InstallationDetails and everything now works perfectly as before. I do not need to disable Build Automatically any more.

Related

I got stuck in creating the flutter project

I am using the Android Studio to create a new flutter project, but it just got stuck when creating the project, for hours. I don't know what to do, need help.
BTW, I am using Mac, there seems no opening with administration mode in it.
It takes Internet Connection for the first time for building the application in flutter, and other aspect also may effects like hardware configuration.
Try starting Android Studio in Administrator mode
Make sure that you have not ticked the "create project offline checkbox".
Keep the "Flutter SDK location" and "Project location" in a local path
(e.g. c:\users\xxxxxx)
I ran into similar problem on my Mac. The following was my state of my machine at the time of the problem.
I had upgraded to macOS Big Sur.
My copy of Android Studio was working before the upgrade.
My copy of flutter was installed using brew before the upgrade.
When I ran into the problem, after a bit of reading,
I uninstalled and reinstalled flutter using brew, and problem went away.
For me, I think there must have some change in directory permission settings that caused Android Studio to get stuck when creating application.

linux mint - android studio emulator process killed

I have just migrate to Mint from windows. I installed android studio v4. As I want to start the emulator, I got into error.
I'll be thank of who can give me a hand.
Add 32-bit support:
https://blog.linuxmint.com/?p=2211
Make sure you install all the dependencies needed by Android Studio:
https://developer.android.com/studio/install
And libvrt for emulation:
https://ubuntu.com/server/docs/virtualization-libvirt
After that, it should work properly. These instructions are valid for Ubuntu, but I think you can find similar packages for Linux Mint. Make sure you install the 32-bit packages (a_package:i386) when the links above require it. If it still doesn't work, try running Android Studio and the emulator from the command line (to see what goes wrong) and send a bug report to the Android Studio team.
My friends help me. He sayed it was due to GPU. He changed the Graphic card.

OS X Yosemite - Android Stuio wont start SDK Manager and can't execute gradle

I’m using MacBookPro OSX YOSEMITE 10.10.3
Till yesterday I was a happy Android Studio user with no complaints. But,
since yesterday Android Studio is making unintelligible trouble.
1. It’s not possible to start SDK Manager.
Every time I try to start it from Tools > Android > SDK Manager this happens:
2. The next issue comes with Gradle.
Every time I run my app this pops up:
My JAVA_HOME is:
$JAVA_HOME
-bash: /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home:
I’ve reinstalled the Android Studio and JRE, Java SDK and Android SDK several times. Nothing changed. Getting same alerts as you see on the pictures.
I’ve also tried this solution with no success.
Do you have any Idea how to fix this problem!?
You can try to install 'Java SE Development Kit 8' to fix this problem. I think it will become normal after that
The reason was, that (my) OSX Yosemite doesn't work with Java 8 für Mac OS X from java.com. I've installed the JRE8 many times, but it was still not working. Here is how to solve that problem:
Like Tram Nguyen said, Open Terminal and type
java -version
if there is no responde like
java version "1.8.0_45"
get Java for OS X 2014-001 from >> Apple !
The Apple version will work on Yosemite.
Try again
java -version
If there is a responde, well done!
Thanks to Tram Nguyen for helping out.

Failure to install APK [INSTALL_FAILED_DEXOPT] Android Studio

I have tried literally everything to try and rectify this error when trying to deploy an app to an actual android device for debugging but have been unable to solve the matter. Everytime I try to launch I get a failed [INSTALL_FAILED_DEXOPT] error and when checking the logcat it is always because there is no classes.dex in my debug apk.
If I run gradlew.bat clean assembleDebug, there is no difference in the apk size so I'm assuming there is a build error in android studio. I am using android studio beta 0.86 and have tried it on 0.89 with the same result. I have tried build tools for 19.1 to 21 with no result. I have also tried different devices and created a new project (that has never been installed on my devices) and android studio seems to think it needs to be uninstalled first when attempting to deploy.
I have tried switching my device to ART, uninstalling and reinstalling android studio, redownloading the sdk and restarting my computer. NOTHING and I mean NOTHING has worked. I think the problem started after I downloaded the lollipop apis but am not sure. I have tried uninstalling all apps with my package signature on my device but NOTHING works! Not even Project -> Clean Project -> Rebuild
This is extremely frustrating as I cannot debug my apps anymore :/ has anyone had any experience with this error or ways to rectify it?
So turns out that the issue was mismatching sdks between Android Studio and the Project. The project was using an old sdk and once I made them the same, I cleaned and rebuilt the project and everything was good to go.
UPDATE:
I ran into the problem again after I tried to update my SDK and its tools. Turns out that when you try to do this, the SDK locks the tools folder and then you get an error saying some file couldn't be overridden. When this happened to me, all the build tools were deleted so there were errors in the .dex file created when debuggin my app.
We are using android 2.2 (really old i know) and couldn't find a fix for this error. Eventually we found this bug https://android-review.googlesource.com/#/c/30900/. The only solution for us was to remove some libraries...
I kept having the same problem - manually building worked fine, but Android Studio would not build a proper APK.
The problem was that I started the project on Android Studio and Android Gradle plugin version 2.0-beta2. After updating the Gradle plugin to 2.0-beta6 through a simple build.gradle change, the builds stopped working.
Turns out that, although I installed a beta version of Android Studio, the update checker only checked the stable channel. After setting the updater to check the canary channel as well, I was able to upgrade Android Studio to version 2.0-beta6 and builds continued to work normally.
You can change the update preference in Android Studio settings under Appearance and Behavior -> System Settings -> Updates.
I encountered this error when storage of the device is full. Try to open some space.
Try run these commands
adb reconnect
adb reconnect device

Gradle gets stuck at either 'build' or 'assembleDebug' when using the 64bit or 32bit version of Android Studio

The issue I've had over the past few months is that Android Studio would often get stuck on Gradle: build, as seen here. Android Studio itself would stay responsive but the build simply wouldn't progress. It also never generates any kind of error, so I can't really post any useful information. Once in a blue moon it might suddenly work, but nothing reliable.
Recently I found a post here on Stack Overflow where someone's Android Studio would get stuck on Gradle: build when he tried to create a new project, and he noticed that this issue didn't exist in the 32-bit version of Android. So I thought, why not try that. Turns out that building isn't an issue anymore, but assembleDebug is, when trying to build the application. As can be seen here.
Of course all these commands work flawlessly when run using command prompt and gradlew.
What I've tried so far:
Reinstalling Android Studio (including the removal of .AndroidStudioProject)
Upgrading Android Studio to the latest version
Removing any build files from projects
Creating completely new projects in Android Studio
Switching from 64-bit to 32-bit Android Studio
I'm running the latest version of Android Studio, using version 19.1.0 of the build tools, gradle v0.11+ and am on Windows 8.1.
Is there anything else I can try? This is starting to become seriously annoying. The last possible solution I can come up with is just doing a complete format and a fresh Windows installation.
I was experiencing the same problem, and the solution was very unexpected in my case: AVAST antivirus was somehow interfering with the Gradle:build process.
Deactivating this antivirus solved the problem!
Because there is no answer to this problem I will share, what I have done, to solve this issue. From what I have seen, the problem is that there is a dependancy(or many) from a maven repo that can not be loaded. So you have to take all dependacy one by one and check if exist on the maven repo.
For example I was having a dependancy for "org.jraf:android-switch-backport:1.3.1" from "http://JRAF.org/static/maven/2" that at that time could not be opened.
My build.gradle looked like this:
repositories {
mavenCentral()
maven {
url "http://JRAF.org/static/maven/2"
}
}
compile "org.jraf:android-switch-backport:1.3.1
For me, this problem occurred when I was USB tethering using an Android device. The first build took anywhere from 5-10 minutes, and every subsequent build took about 3-7 seconds. I found that by disabling USB tethering, the first build completed quickly (and so would all subsequent builds). After the first build completed, I could reenable USB tethering.
If you have a fresh Ubuntu 14.04 with Android Studio 1.5, you may be missing a library. Try this:
sudo apt-get install lib32z1
Another stack overflow answer
It happens 1 in 2 times for me. The hack that works for me is File->Exit and confirm exiting. Then a message shows up telling me that Gradle is running and then all of a sudden the screen to choose the device shows up. I Click NO and all goes well again.
Anyway, still a bummer, but I have not found an answer yet.
My problem was that the Android Sdk executables were missing the executable bit. You can check some of your binaries like /Sdk/build-tools//aapt to see if they have permission to execute. If not you can solve it by running this on the Sdk folder
chmod -R +x ./
If you are behind a proxy on ubunthu you might need to set your gradle system wide proxy:
sudo nano ~/.gradle/gradle.properties
And enter the following entries:
systemProp.http.proxyHost=<Your Host>
systemProp.http.proxyPort=<Your Host Port>

Categories

Resources