MarcinM MarcinM - 4 years ago 101
Linux Question

Android SDK "no such file" while file exists

I just migrated from Windows to Linux Mint. I downloaded the SDK and started using it. AVD manager is working, and I'm even able to start from intellij, but when I asked to launch some device it said me:

Starting emulator for AVD 'Pakon'


Failed to start emulator: Cannot run program
"/home/marcinm/Programy/sdk/tools/emulator": error=2, No such file or
directory


While I checked and there is such file in this directory.

Also when I want to compile project the error message is saying to me:


Error:android-apt-compiler: Cannot run program
"/home/marcinm/Programy/sdk/build-tools/19.1.0/aapt": error=2, No
such file or directory


While there also is aapt file on this directory.

Anyone has idea how to fix it?

UPDATE:

I found the solution. There must be package provided. I fixed it by changing code to:

@Test
fun simpleGenerationTest() {
val beforeProcess = "com.example.activitystarter.MainActivity" to """
package com.example.activitystarter;

import android.app.Activity;
import activitystarter.MakeActivityStarter;

@MakeActivityStarter
public class MainActivity extends Activity {}
"""

val afterProcess = "com.example.activitystarter.MainActivityStarter" to """
package com.example.activitystarter;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.UiThread;

public class MainActivityStarter {
@UiThread
public static void fill(MainActivity activity) {
}

@UiThread
public static void start(Context context) {
Intent intent = new Intent(context, MainActivity.class);
context.startActivity(intent);
}

@UiThread
public static void startWithFlags(Context context, int flags) {
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(flags);
context.startActivity(intent);
}

@UiThread
public static Intent getIntent(Context context) {
Intent intent = new Intent(context, MainActivity.class);
return intent;
}
}
"""

processingComparator(beforeProcess, afterProcess)
}

Answer Source

Are you running a 64-bit version? As per here it seems that you need to install some 32 bit libraries:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download