Hot questions for Using Ubuntu in android

Question:

I have always avoided using Eclipse because I have had nothing but bad experiences with it. I have used it in three different computers, two with Ubuntu 13 and now in a new laptop with Ubuntu 14.

The problem I got is always the same: Eclipse just freezes, stops working. Back then with Eclipse for Java EE developers with some BPEL plugins it just randomly froze every 20 minutes and I had to force close it and it always messed the configuration.

Now I am using Eclipse for Android apps development. First I tried with standard Eclipse, and not only I got a lot of errors in the code with just creating a new Android project, but the interface would dissapear and come back partially when I hovered the mouse over that gone part, but it also froze when it wanted.

Then at some point just creating a new Android project froze the whole program. I just tried downloading Eclipse Java EE and the same thing happens: creating a new Android app project freezes Eclipse and all I get is a half-created, corrupted project.

I tried maximizing the memory Eclipse used and added a little hack I found around StackOverflow that is supposed to help. But none of these solutions did any good.

Here's my eclipse.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx2048m
-Dorg.eclipse.swt.browser.DefaultType=mozilla

Any help?


Answer:

I've had a similar problem using Eclipse Luna on my ubuntu 12.04, then I found this blog page http://blog.vogella.com/2014/02/21/using-eclipse-luna-on-ubunbu/ which gave me a solution.

Just create a script:

touch eclipse.sh

Fill it with this content:

#!/bin/bash

export SWT_GTK3=0
export UBUNTU_MENUPROXY=0
./eclipse -showlocation

Put this script in your eclipse directory then make it executable

 chmod +x eclipse.sh

and finally run it. Hope that helps.

Question:

First, i have done a lot of research and this is the answer i think the best :

https://stackoverflow.com/a/17498043/1203797

According to that answer, my eclipse.ini should be on the same directory of my eclipse because i downloded it from the internet (not via terminal/software center).

I need to change the RAM used by my eclipse because i keep getting GC overheat error when trying to run a big application.

This is my eclipse.ini :

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
2048m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=2048m
-Xms512m
-Xmx2048m

Note that i have updated the Xmx/Xms value, but :

-product
org.eclipse.epp.package.jee.product
-vm
/usr/bin/java
eclipse.home.location=file:/home/tama/DEVELOPMENT/adt-bundle/eclipse/
eclipse.launcher=/home/tama/DEVELOPMENT/adt-bundle/eclipse/eclipse
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=@config.dir/../p2/
eclipse.p2.profile=epp.package.jee
eclipse.product=org.eclipse.epp.package.jee.product
eclipse.startTime=1417076772881
eclipse.stateSaveDelayInterval=30000
eclipse.vm=/usr/bin/java
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m

That is what displayed in Eclipse Installation Detail (I know this from the answer i posted above).

Please kindly help me, Thanks for your time.


Answer:

I spent hours, now i want to cry and laugh at the same time.

The shortcut that in the ubuntu's launcher does not use the eclipse.ini in the eclipse's directory, eventhough it linked to the same eclipse.

I need to run the eclipse from the directory manually or create a shortcut to the desktop, then the eclipse.ini will be readed

Question:

I'm starting with Android Programming at the moment. I'm using die Android SDK and Eclipse. I downloaded the Bundle from the developer.android.com . At first it seems good, but when finishing the wizard for a new Android Project, Eclipse crashes. The programm returns the following error:

I already tried to run "ulimit -c unlimited", with no effect.

I'm running Kubuntu 14.04 (Linux/Debian/Ubuntu) and Java 1.7.0_55.

Any help?


Answer:

You need to change the Desktop Theme to a different theme.

For KDE users goto: Configure Desktop => Application Appearance => GTK and change the theme from oxygen-gtk to Adwaita. Your Eclipse will no longer crash and the desktop will look more premium.

Question:

I'm new to ubuntu, and want to develop android apps with eclipse (because I heard that the android studio can't work very well with NDK stuff yet).

First I installed java-8-oracle with apt-get, it was automatically installed under/usr/lib/jvm/java-8-oracle, then I set the environment variables, and executed java -version to test if is well installed, everything was fine I even wrote a HelloWorld in java using gedit and ran it in command line ,so there should be nothing wrong with the JDK I think.

But after I installed the eclipse and sdk (extracted frome adt-bundle-linux-x86_64-20140702.zip I download), when I opened the eclipse and tried to launch the SDK manager, the problem came like this (eguil is my username):

[2015-07-30 10:09:48 - SDK Manager] [SDK Manager] /home/eguil/android/sdk/tools/android: 1: /home/eguil/android/sdk/tools/android: /usr/lib/jvm/java-8-oracle: Permission denied
[2015-07-30 10:09:48 - SDK Manager] [SDK Manager] /home/eguil/android/sdk/tools/android: 1: /home/eguil/android/sdk/tools/android: /usr/lib/jvm/java-8-oracle: Permission denied
[2015-07-30 10:09:48 - SDK Manager] [SDK Manager] /home/eguil/android/sdk/tools/android: 110: exec: /usr/lib/jvm/java-8-oracle: Permission denied

Then I executed the command

sudo chmod -R 777 /home/eguil/android(where the eclipse and SDK are installed)

and

sudo chmod -R 777 /usr/lib/jvm/java-8-oracle

I assumed that I should never have any "permission problems" from now, but I was wrong, the problem still exists. I'v also tried launching the SDK manager in commond line sudo ./home/eguil/android/sdk/tools/android, but the output was the same.

Could anyone tell me the reason and how to solve the problem? I'll be appreciated, It's driving me crazy.


Answer:

That isn't how you set the Java environment in ubuntu. Use

update-java-alternatives -s java-8-oracle

And you can list JVM(s) available with

update-java-alternatives -l

Question:

I've been developing Android apps on Eclipse 4.2.2 and Java 1.6.0_21 on Ubuntu 12.04 LTS without any problems. Recently I got an upgrade notification for 14.04 and so I upgraded. Now I keep getting the following error in Eclipse

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f90b685a2a1, pid=7131, tid=140264058119936
#
# JRE version: 6.0_21-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 )
# Problematic frame:
# C  [libsoup-2.4.so.1+0x6c2a1]  soup_session_feature_detach+0x11
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid7131.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

Any idea what's wrong?


Answer:

OK, I found a solution, which is to add the following line to eclipse.ini

-Dorg.eclipse.swt.browser.DefaultType=mozilla

Question:

I have a problem when i enter the ionic cordova build android. I am not able to create an apk file on ubuntu 18.04.

I get the following error:

Exception in thread "main" 
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1921)
    at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1904)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1420)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
    at org.gradle.wrapper.Download.downloadInternal(Download.java:60)
    at org.gradle.wrapper.Download.download(Download.java:45)
    at org.gradle.wrapper.Install$1.call(Install.java:62)
        at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:91)
    at sun.security.validator.Validator.getInstance(Validator.java:179)
    at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312)
    at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:987)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
    ... 14 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
    at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120)
    at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104)
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:89)
    ... 26 more
(node:17896) UnhandledPromiseRejectionWarning: Error: /home/wzcoder/tzouq/platforms/android/gradlew: Command failed with exit code 1 Error output:
Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1921)
    at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1904)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1420)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
    at org.gradle.wrapper.Download.downloadInternal(Download.java:60)
    at org.gradle.wrapper.Download.download(Download.java:45)
    at org.gradle.wrapper.Install$1.call(Install.java:62)
    at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:91)
    at sun.security.validator.Validator.getInstance(Validator.java:179)
    at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312)
    at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:987)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
    ... 14 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
    at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120)
    at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104)
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:89)
    ... 26 more
    at ChildProcess.whenDone (/home/wzcoder/tzouq/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:17896) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:17896) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Can anyone help me?


Answer:

I got the same error with you, and I found the solution at https://askubuntu.com/questions/971059/17-10-openjdk-and-oracle-jdk-8-and-9-the-trustanchors-parameter-must-be-non-empt

Update the CA certificates using: sudo update-ca-certificates -f and sudo apt install ca-certificates-java --reinstall

Question:

I am looking for help with the Android AOSP setup for a project. I am trying to build Android 4.3_r1 from source on Ubuntu 16.04.3 LTS (Xenial) , I have installed all the dependencies and the oracle Java 6 . The build runs well until one point where I get the following error :

******************************
You have tried to change the API from what has been previously 
approved.
To make these errors go away, you have two choices:
   1) You can add "@hide" javadoc comments to the methods, etc. listed 
   in the errors above.
   2) You can update current.txt by executing the following command:
     make update-api
     To submit the revised current.txt to the main Android repository,
     you will need approval.
******************************

Tried removing the current.txt ,redoing the steps from scratch , make update-api also still facing the same error.Any help would be appreciated .


Answer:

So after trying out several fixes it did not work out for me, so i reinstalled java and the AOSP to get it to work.

Question:

Nexus 4 API 22.

I'm using Ubuntu. Android Studio 3.0. I run the application on a standard emulator and get this error

    08-29 14:21:03.962 5343-5343/com.knowledgecity.us_site I/MultiDex: VM with version 2.1.0 has multidex support
08-29 14:21:03.962 5343-5343/com.knowledgecity.us_site I/MultiDex: Installing application
08-29 14:21:03.962 5343-5343/com.knowledgecity.us_site I/MultiDex: VM has multidex support, MultiDex support library is disabled.
08-29 14:21:04.058 5343-5343/com.knowledgecity.us_site I/InstantRun: starting instant run server: is main process
08-29 14:21:04.067 5343-5343/com.knowledgecity.us_site I/MultiDex: Installing application
08-29 14:21:04.067 5343-5343/com.knowledgecity.us_site I/MultiDex: VM has multidex support, MultiDex support library is disabled.
08-29 14:21:04.361 5343-5343/com.knowledgecity.us_site W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
08-29 14:21:04.420 5343-5355/com.knowledgecity.us_site I/art: Background sticky concurrent mark sweep GC freed 4119(386KB) AllocSpace objects, 4(64KB) LOS objects, 1% free, 2MB/2MB, paused 747us total 101.676ms
08-29 14:21:04.567 5343-5355/com.knowledgecity.us_site W/art: Suspending all threads took: 10.350ms
08-29 14:21:04.568 5343-5355/com.knowledgecity.us_site I/art: Background sticky concurrent mark sweep GC freed 71(34KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 3MB/3MB, paused 10.906ms total 39.420ms
08-29 14:21:04.583 5343-5343/com.knowledgecity.us_site I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
08-29 14:21:04.708 5343-5355/com.knowledgecity.us_site W/art: Suspending all threads took: 8.592ms
08-29 14:21:04.709 5343-5355/com.knowledgecity.us_site I/art: Background partial concurrent mark sweep GC freed 238(16KB) AllocSpace objects, 0(0B) LOS objects, 36% free, 6MB/10MB, paused 9.362ms total 21.672ms
08-29 14:21:04.760 5343-5404/com.knowledgecity.us_site D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

                                                                         [ 08-29 14:21:04.761  5343: 5343 D/         ]
                                                                         HostConnection::get() New Host Connection established 0xa3c490b0, tid 5343


                                                                         [ 08-29 14:21:04.763  5343: 5343 W/         ]
                                                                         Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 
08-29 14:21:04.764 5343-5343/com.knowledgecity.us_site D/Atlas: Validating map...
08-29 14:21:04.793 5343-5404/com.knowledgecity.us_site I/OpenGLRenderer: Initialized EGL, version 1.4
08-29 14:21:04.793 5343-5404/com.knowledgecity.us_site W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
08-29 14:21:04.799 5343-5404/com.knowledgecity.us_site D/EGL_emulation: eglCreateContext: 0xa3c21700: maj 2 min 0 rcv 2
08-29 14:21:04.945 5343-5404/com.knowledgecity.us_site D/EGL_emulation: eglMakeCurrent: 0xa3c21700: ver 2 0
08-29 14:21:04.957 5343-5404/com.knowledgecity.us_site D/OpenGLRenderer: Enabling debug mode 0
08-29 14:21:05.067 5343-5404/com.knowledgecity.us_site D/EGL_emulation: eglMakeCurrent: 0xa3c21700: ver 2 0
08-29 14:21:05.128 5343-5343/com.knowledgecity.us_site W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
08-29 14:21:05.192 5343-5380/com.knowledgecity.us_site A/libc: Fatal signal 4 (SIGILL), code 2, fault addr 0xb72085ce in tid 5380 (Queue)

I tried the same thing on Genimotion. Android 4 and 5.0 6.0. Everything is the same.

But if you do the same thing on a real phone. By the way I have Android 6.0. That all works fine. On other phones also checked.

Ie it turns out that there is some mistake with the emulator or Ubuntu.

What can be done to correct this error?

Thank you in advance


By the way, I noticed such a thing. What if I disable the Internet on the emulator, then the application is launched. But if I turn on the Internet to log in, I get an error.

Ie the application tries to use the Internet via the emulator and I get an error at this time.

Who faced this?)))


Answer:

just enable multidex : follow these steps

android {    
defaultConfig {
    // Enabling multidex support.
    multiDexEnabled true
}  
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}

create one class like this

public class Multi_Dex extends Application {
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}
}

now in your manifiest file add this

<application
    android:name=".Multi_Dex"
    android:allowBackup="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">