Ubuntu上的android sdk提示 ./emulator: No such file or directory如何解决

 更新时间:2016年9月20日 19:58  点击:2131
在64位的Ubuntu上运行android sdk遇到“-bash: ./emulator: No such file or directory”的错误提示,发现是64位的Ubuntu系统上刚好缺少所依赖的32位的库。

前几天在Xen或者KVM的guest上运行Android emulator来模拟Android系统的运行。当时是使用64位的Ubuntu 12.10系统作为guest,在其中运行emulator或emulator-x86时遇到“-bash: ./emulator: No such file or directory”的错误提示,这个错误提示的有点莫名其妙,很难看明白到底发生了什么情况。后来,我发现是由于这两个二进制文件是32bit的它会依赖一些32bit的共享库文件,而该64位Ubuntu系统上刚好缺少所需的32位的库。所以,这个问题的解决方法是用“sudo apt-get install ia32-libs”命令安装32位的库。另外可以用“ldd emulator”命令查看一下,emulator执行文件说依赖的共享库有哪些,可能会出现一些是“not found”的情况,然后依次安装相应的共享库即可。

 代码如下 复制代码
linux@Ubuntu12.10:~/android-sdk-linux/tools$ ./emulator-x86 -avd test1
-bash: ./emulator-x86: No such file or directory
linux@Ubuntu12.10:~/android-sdk-linux/tools$ ./emulator -avd test1
-bash: ./emulator: No such file or directory
 
linux@Ubuntu12.10:~/android-sdk-linux/tools$ sudo apt-get install ia32-libs
 
linux@Ubuntu12.10:~/android-sdk-linux/tools$ ldd emulator
        linux-gate.so.1 =>  (0xf7776000)
        libutil.so.1 => /lib/i386-linux-gnu/libutil.so.1 (0xf7757000)
        librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf774e000)
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7732000)
        libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7649000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf761d000)
        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf75ff000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7455000)
        /lib/ld-linux.so.2 (0xf7777000)


另外,使用KVM加速的Android emulator在x86平台上用起来还是真不错的。顺手记几个命令吧,下次如果使用时,我也可以方便参考。

 代码如下 复制代码
linux@Ubuntu12.10:~/android-sdk-linux/tools$ ./android list targets
Available Android targets:
----------
............
----------
id: 3 or "android-16"
     Name: Android 4.1
     Type: Platform
     API level: 16
     Revision: 2
     Skins: HVGA, WXGA800, WSVGA, WXGA800-7in, WQVGA432, QVGA, WVGA800 (default), WVGA854, WXGA720, WQVGA400
     ABIs : armeabi-v7a, x86
 
linux@Ubuntu12.10:~/android-sdk-linux/tools$ ./android create avd -n test1 -t 3 -b x86
 
linux@Ubuntu12.10:~/android-sdk-linux/tools$ ./emulator-x86 -avd test1 -qemu -m 1024 -enable-kvm


关于Android emulator的参考参考资料:
Android SDK下载地址:http://developer.android.com/sdk/index.html#download
emulator的使用:http://developer.android.com/tools/devices/emulator.html
命令行管理AVD文件:http://developer.android.com/tools/devices/managing-avds-cmdline.html

下面来给各位介绍一个Android开发之Universal-Image-Loader解析DisplayImageOptions的详细配置,希望对各位有用.


在使用这个框架的时候,我们必须要配置一个DisplayImageOptions对象来作为ImageLoader.getInstance().displayImage()中的参数,所以很有必要讲解这个对象的配制方法。讲解完了后其实这个框架我们就会了解的比较详尽了。

1.默认的配置

DisplayImageOptions options = new DisplayImageOptions.Builder()
    .showImageOnLoading(R.drawable.ic_stub) // resource or drawable
    .showImageForEmptyUri(R.drawable.ic_empty) // resource or drawable
    .showImageOnFail(R.drawable.ic_error) // resource or drawable
    .resetViewBeforeLoading(false)  // default
    .delayBeforeLoading(1000)
    .cacheInMemory(false) // default
    .cacheOnDisk(false) // default
    .preProcessor(...)
    .postProcessor(...)
    .extraForDownloader(...)
    .considerExifParams(false) // default
    .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) // default
    .bitmapConfig(Bitmap.Config.ARGB_8888) // default
    .decodingOptions(...)
    .displayer(new SimpleBitmapDisplayer()) // default
    .handler(new Handler()) // default
    .build();

example:

/**
     * 显示图片的所有配置
     * @return
     */
    private DisplayImageOptions getWholeOptions() {
        DisplayImageOptions options = new DisplayImageOptions.Builder() 
        .showImageOnLoading(R.drawable.loading) //设置图片在下载期间显示的图片 
        .showImageForEmptyUri(R.drawable.ic_launcher)//设置图片Uri为空或是错误的时候显示的图片 
        .showImageOnFail(R.drawable.error)  //设置图片加载/解码过程中错误时候显示的图片
        .cacheInMemory(true)//设置下载的图片是否缓存在内存中 
        .cacheOnDisk(true)//设置下载的图片是否缓存在SD卡中 
        .considerExifParams(true)  //是否考虑JPEG图像EXIF参数(旋转,翻转)
        .imageScaleType(ImageScaleType.IN_SAMPLE_INT)//设置图片以如何的编码方式显示 
        .bitmapConfig(Bitmap.Config.RGB_565)//设置图片的解码类型
        //.decodingOptions(BitmapFactory.Options decodingOptions)//设置图片的解码配置 
        .delayBeforeLoading(0)//int delayInMillis为你设置的下载前的延迟时间
        //设置图片加入缓存前,对bitmap进行设置 
        //.preProcessor(BitmapProcessor preProcessor) 
        .resetViewBeforeLoading(true)//设置图片在下载前是否重置,复位 
        .displayer(new RoundedBitmapDisplayer(20))//不推荐用!!!!是否设置为圆角,弧度为多少 
        .displayer(new FadeInBitmapDisplayer(100))//是否图片加载好后渐入的动画时间,可能会出现闪动
        .build();//构建完成
       
        return options;
    }

2.一般常用的配置

    /**
     * 设置常用的设置项
     * @return
     */
    private DisplayImageOptions getSimpleOptions() {
        DisplayImageOptions options = new DisplayImageOptions.Builder() 
        .showImageOnLoading(R.drawable.loading) //设置图片在下载期间显示的图片 
        .showImageForEmptyUri(R.drawable.ic_launcher)//设置图片Uri为空或是错误的时候显示的图片 
        .showImageOnFail(R.drawable.error)  //设置图片加载/解码过程中错误时候显示的图片
        .cacheInMemory(true)//设置下载的图片是否缓存在内存中 
        .cacheOnDisk(true)//设置下载的图片是否缓存在SD卡中 
        .imageScaleType(ImageScaleType.IN_SAMPLE_INT)//设置图片以如何的编码方式显示 
        .bitmapConfig(Bitmap.Config.RGB_565)//设置图片的解码类型
        .build();//构建完成
        return options;
    }
 

注意:这里面的参数当然也是可以随意修改的,根据项目需要再定!

几点说明:

 
1).imageScaleType(ImageScaleType imageScaleType)  //设置图片的缩放方式,如:

.imageScaleType(ImageScaleType.IN_SAMPLE_INT)
 

其中,mageScaleType的选择值:
EXACTLY :图像将完全按比例缩小的目标大小
EXACTLY_STRETCHED:图片会缩放到目标大小完全
IN_SAMPLE_INT:图像将被二次采样的整数倍
IN_SAMPLE_POWER_OF_2:图片将降低2倍,直到下一减少步骤,使图像更小的目标大小
NONE:图片不会调整

 2).displayer(BitmapDisplayer displayer)  // 设置图片的显示方式,如:

.displayer(new FadeInBitmapDisplayer(100))
 

其中,displayer的选择值:

 

RoundedBitmapDisplayer(int roundPixels)设置圆角图片,不推荐!!!
FakeBitmapDisplayer()这个类什么都没做
FadeInBitmapDisplayer(int durationMillis)设置图片渐显的时间
SimpleBitmapDisplayer()正常显示一张图片

 

3.避免OOM

 

.bitmapConfig(Bitmap.Config.RGB_565) //默认是ARGB_8888,使用RGB_565会比使用ARGB_8888少消耗2倍的内

 

使用.imageScaleType(ImageScaleType.IN_SAMPLE_INT) 或imageScaleType(ImageScaleType.EXACTLY)

 

避免使用.displayer(new RoundedBitmapDisplayer(20)) //他会创建新的ARGB_8888格式的Bitmap对象;

下面来为各位介绍一个关于Android优化双缓存的图片异步加载工具(LruCache+SoftReference)例子,希望对大家有帮助.


之前在郭大神的博客看到使用LruCache算法实现图片缓存的.这里仿效他的思路,自己也写了一个. 并加入ConcurrentHashMap<String, SoftReference<Bitmap>>去实现二级缓存,因为ConcurrentHashMap是多个锁的线程安全,支持高并发.很适合这种频繁访问读取内存的操作.


下面整个思路是,使用了系统提供的LruCache类做一级缓存, 大小为运行内存的1/8,当LruCache容量要满的时候,会自动将系统移除的图片放到二级缓存中,但为了避免OOM的问题,这里将SoftReference软引用加入来,当系统快要OOM的时候会自动清除里面的图片内存,当然内存充足时就会继续保存这些二级缓存的图片.强调一点,不要用SoftReference去做一级缓存,现在的java中垃圾回收加强了对SoftReference软引用的回收机制,它只适合临时的保存一些数据缓存,并不适合长期的(相对临时而言,并不是真正的长期).


直接上代码,拿来即用哦:

/**
 * Created on 3/11/2015
 * <br>图片异步加载工具(支持本地图片加载,网络图片URL和项目内图片资源加载)
 * <br>支持双缓存: LruCache和SoftReference
 * @author Mr.Et
 *
 */
public class ImageLoadManager {
 /** 图片源类型: 文件,网络,资源ID **/
 public enum IMAGE_LOAD_TYPE
 {
  FILE_PATH,FILE_URL,FILE_RESOURCE_ID
 }
 
 private String TAG = "ImageLoadManager...";
 
 private Context context;
 
 private Set<ImageLoadTask> taskCollection;
 
 /** 最大内存 **/
 final static int maxCacheSize = (int)(Runtime.getRuntime().maxMemory() / 8);
 
 /** 建立线程安全,支持高并发的容器 **/
 private static ConcurrentHashMap<String, SoftReference<Bitmap>> currentHashmap
  = new ConcurrentHashMap<String, SoftReference<Bitmap>>();
 
 
 
 
 
 
 
 public ImageLoadManager(Context context)
 {
  super();
  this.context = context;
  taskCollection = new HashSet<ImageLoadManager.ImageLoadTask>();
 }
 
 private static LruCache<String, Bitmap> BitmapMemoryCache = new LruCache<String, Bitmap>(maxCacheSize)
 {
  @Override
  protected int sizeOf(String key, Bitmap value)
  {
   if(value != null)
   {
    return value.getByteCount();
    //return value.getRowBytes() * value.getHeight(); //旧版本的方法
   }
   else
   {
    return 0;
   }
  }
  
  //这个方法当LruCache的内存容量满的时候会调用,将oldValue的元素移除出来腾出空间给新的元素加入
  @Override
  protected void entryRemoved(boolean evicted, String key,Bitmap oldValue, Bitmap newValue)
  {
   if(oldValue != null)
   {
    // 当硬引用缓存容量已满时,会使用LRU算法将最近没有被使用的图片转入软引用缓存   
    currentHashmap.put(key, new SoftReference<Bitmap>(oldValue));
   }
  }
  
 };
 
 /**
  * 针对提供图片资源ID来显示图片的方法
  * @param loadType 图片加载类型
  * @param imageResourceID 图片资源id
  * @param imageView 显示图片的ImageView
  */
 public void setImageView(IMAGE_LOAD_TYPE loadType, int imageResourceID, ImageView imageView)
 {
  if(loadType == IMAGE_LOAD_TYPE.FILE_RESOURCE_ID)
  {
//   if(ifResourceIdExist(imageResourceID))
//   {
//    imageView.setImageResource(imageResourceID);
//    
//   }else{ //映射无法获取该图片,则显示默认图片
//    imageView.setImageResource(R.drawable.pic_default);
//   }
   try
   {
    imageView.setImageResource(imageResourceID);
    return;
   } catch (Exception e) {
    Log.e(TAG, "Can find the imageID of "+imageResourceID);
    e.printStackTrace();
   }
   //默认图片
   imageView.setImageResource(R.drawable.pic_default);
  }
 }
 
 /**
  * 针对提供图片文件链接或下载链接来显示图片的方法
  * @param loadType  图片加载类型
  * @param imageFilePath 图片文件的本地文件地址或网络URL的下载链接
  * @param imageView 显示图片的ImageView
  */
 public void setImageView(IMAGE_LOAD_TYPE loadType, String imageFilePath, ImageView imageView)
 {
  if(imageFilePath == null || imageFilePath.trim().equals(""))
  {
   imageView.setImageResource(R.drawable.pic_default);
   
  }else{
   Bitmap bitmap = getBitmapFromMemoryCache(imageFilePath);
   if(bitmap != null)
   {
    imageView.setImageBitmap(bitmap);
   }
   else
   {
    imageView.setImageResource(R.drawable.pic_default);
    ImageLoadTask task = new ImageLoadTask(loadType, imageView);
    taskCollection.add(task);
    task.execute(imageFilePath);
   }
  }
 }
 
 /**
  * 从LruCache中获取一张图片,如果不存在就返回null
  * @param key  键值可以是图片文件的filePath,可以是图片URL地址
  * @return Bitmap对象,或者null
  */
 public Bitmap getBitmapFromMemoryCache(String key)
 { 
  try
  {
   if(BitmapMemoryCache.get(key) == null)
   {
    if(currentHashmap.get(key) != null)
    {
     return currentHashmap.get(key).get();
    }
   }
   return BitmapMemoryCache.get(key);
   
  } catch (Exception e) {
   e.printStackTrace();
  }
  return BitmapMemoryCache.get(key);
 }
 
 /**
  * 将图片放入缓存
  * @param key
  * @param bitmap
  */
 private void addBitmapToCache(String key, Bitmap bitmap)
 {
  BitmapMemoryCache.put(key, bitmap);
 }
 
 
 /**
  * 图片异步加载
  * @author Mr.Et
  *
  */
 private class ImageLoadTask extends AsyncTask<String, Void, Bitmap>
 {
  private String imagePath;
  private ImageView imageView;
  private IMAGE_LOAD_TYPE loadType;
  
  public ImageLoadTask(IMAGE_LOAD_TYPE loadType , ImageView imageView)
  {
   this.loadType = loadType;
   this.imageView = imageView;
  }
  
  @Override
  protected Bitmap doInBackground(String...params)
  {
   imagePath = params[0];
   try
   {
    if(loadType == IMAGE_LOAD_TYPE.FILE_PATH)
    {
     if(new File(imagePath).exists())
     { //从本地FILE读取图片
      BitmapFactory.Options opts = new BitmapFactory.Options();
      opts.inSampleSize = 2;
      Bitmap bitmap = BitmapFactory.decodeFile(imagePath, opts);
      //将获取的新图片放入缓存
      addBitmapToCache(imagePath, bitmap);
      return bitmap;
     }
     return null;
    }
    else if(loadType == IMAGE_LOAD_TYPE.FILE_URL)
    { //从网络下载图片
     byte[] datas = getBytesOfBitMap(imagePath);
     if(datas != null)
     {
//      BitmapFactory.Options opts = new BitmapFactory.Options();
//      opts.inSampleSize = 2;
//      Bitmap bitmap = BitmapFactory.decodeByteArray(datas, 0, datas.length, opts);
      Bitmap bitmap = BitmapFactory.decodeByteArray(datas, 0, datas.length);
      addBitmapToCache(imagePath, bitmap);
      return bitmap;
     }
     return null;
    }
    
   } catch (Exception e) {
    e.printStackTrace();
    FileUtils.saveExceptionLog(e);
    //可自定义其他操作
   }
   return null;
  }
  
  @Override
  protected void onPostExecute(Bitmap bitmap)
  {
   try
   {
    if(imageView != null)
    {
     if(bitmap != null)
     {
      imageView.setImageBitmap(bitmap);
     }
     else
     {
      Log.e(TAG, "The bitmap result is null...");
     }
    }
    else
    {
     Log.e(TAG, "The imageView is null...");
     //获取图片失败时显示默认图片
     imageView.setImageResource(R.drawable.pic_default);
    }
    
   } catch (Exception e) {
    e.printStackTrace();
    FileUtils.saveExceptionLog(e);
   }
  }
  
  
 }
 
 
 /**
  * InputStream转byte[]
  * @param inStream
  * @return
  * @throws Exception
  */
 private byte[] readStream(InputStream inStream) throws Exception{ 
        ByteArrayOutputStream outStream = new ByteArrayOutputStream(); 
        byte[] buffer = new byte[2048]; 
        int len = 0; 
        while( (len=inStream.read(buffer)) != -1){ 
            outStream.write(buffer, 0, len); 
        } 
        outStream.close(); 
        inStream.close(); 
        return outStream.toByteArray(); 
    }
 
 /**
  * 获取下载图片并转为byte[]
  * @param urlStr
  * @return
  */
 private byte[] getBytesOfBitMap(String imgUrl){
  try {
   URL url = new URL(imgUrl);
   HttpURLConnection conn = (HttpURLConnection) url.openConnection();
   conn.setConnectTimeout(10 * 1000);  //10s
   conn.setReadTimeout(20 * 1000);
         conn.setRequestMethod("GET"); 
         conn.connect();
         InputStream in = conn.getInputStream();
         return readStream(in);
  } catch (IOException e) {
   e.printStackTrace();
  } catch (Exception e) {
   e.printStackTrace();
  }
  return null;
 }
 
 /**
  * 该资源ID是否有效
  * @param resourceId 资源ID
  * @return
  */
 private boolean ifResourceIdExist(int resourceId)
 {
  try
  {
   Field field = R.drawable.class.getField(String.valueOf(resourceId));
   Integer.parseInt(field.get(null).toString());
   return true;
   
  } catch (Exception e) {
   e.printStackTrace();
  }
  return false;
 }
 
 /**
  * 取消所有任务
  */
 public void cancelAllTask()
 {
  if(taskCollection != null){
   for(ImageLoadTask task : taskCollection)
   {
    task.cancel(false);
   }
  }
 }
 
 
}

In addition, 如果需要更加完美的体验,还可以加入第三级的缓存机制, 比如将图片缓存到本地的磁盘存储空间中.但是又不想这些缓存在本地的图片被其他应用扫描到或者被用户看到怎么办? 这里有几个思路, 比如将图片用加密算法转为字符串存储,或者将图片转为自定义格式的未知文件去放在隐蔽的地方(很多应用都采取了这种方式). 这个不妨自己去尝试实现哦~

本文来分享我在Ubuntu使用Android SDK开发经验的几点总结,测试环境为:Ubuntu 12.04 x86_64,ADT Bundle Linux x86_64 。

测试硬件环境:

打开了Intel VT的PC (使用KVM时需要VT支持的)

测试软件环境:

Ubuntu 12.04 x86_64

ADT Bundle Linux x86_64 (在android官网下载:https://developer.android.com/sdk/index.html )

1. 下载所需的Image和创建AVD:

可以在Eclipse(ADT)中,”Window” -> “Andorid SDK Manager”来打开SDK管理器进行下载,需要下载相应版本(如Android 4.2.2/4.3)的SDK Platform及其对应的ARM或Intel x86 Atom的系统镜像(如果要在Intel PC上使用Emulator并且要使用KVM加速,则一定需要下载Intel x86 Atom的系统镜像)。另外,由于SDK Manager是默认到google.com的一些网站下载相关的信息,如果发现有连接不上的情况(原因你懂的),可以通过”Tools”->”Options”中设置你自己的代理。

在Eclipse-ADT中,”Window” -> “Andorid Virtual Device Manager” 来打开AVD管理器,在上面可以创建自己的AVD文件,注意:如果要在Intel平台上使用KVM加速,则创建AVD时,对CPU/ABI的选择是 “Intel Atom (x86)”。

另外,如果使用一些程序时,其定义的API没有找到,就需要自己下载了;比如,当前有Android API 18 SDK,可能某个程序需要API 17,就需要下载Android 17的SDK了。

2. KVM加速:

我们都知道,运行Android Emulator时很慢的,有时慢到难以忍受。

如果在Android Emulaor中使用了KVM,则可以实现启动和运行时程序的加速,效果可能提高5~10倍的执行速度;记得用x86那种AVD。

一些命令行操作如下:

 代码如下 复制代码
jay@jay-linux:~$ sudo modprobe kvm
jay@jay-linux:~$ sudo modprobe kvm_intel
 
jay@jay-linux:~$ lsmod | grep kvm
kvm_intel             137721  0
kvm                   415550  1 kvm_intel
 
jay@jay-linux:~$ ps -ef | grep emulator | grep -v grep
jay      11749 10704 14 19:48 pts/18   00:02:18 /home/jay/adt-bundle-linux-x86_64-20130917/sdk//tools/emulator64-x86 -avd Android-4.2-x86 -scale 0.23
 
jay@jay-linux:~$ lsmod | grep kvm
kvm_intel             137721  3
kvm                   415550  1 kvm_intel
# 可看使用Emualtor后,kvm_intel模块已经有3个引用了。

3. OpenGL ES:

如果有OpenGL ES的支持,则可以在Emulator中有更好的图像处理能力,比如:可以运行一些3D的程序。

当本机缺少或ADT没找到OpenGL相关的库时,会遇到如下的错误。

 代码如下 复制代码
[2013-10-10 18:34:19 - App2] Launching a new emulator with Virtual Device 'Android-4.2-x86'
[2013-10-10 18:34:26 - Emulator] Failed to load libGL.so
[2013-10-10 18:34:26 - Emulator] error libGL.so: cannot open shared object file: No such file or directory
[2013-10-10 18:34:26 - Emulator] Failed to load libGL.so
[2013-10-10 18:34:26 - Emulator] error libGL.so: cannot open shared object file: No such file or directory
[2013-10-10 18:34:26 - Emulator] emulator: emulator window was out of view and was recentered

解决方法也很简单,一般来说都是有了库的,只是需要添加一个软连接而已;有时,库也缺少,那么就需要先安装GL相关的软件库,再建立软连接。

 代码如下 复制代码
# 如果在/usr/lib下找不到libGL相关的东西,可以用 sudo apt-get install libgl1-mesa-glx  来安装相应的软件库。
jay@jay-linux:~$ ll /usr/lib/x86_64-linux-gnu/mesa/
total 428
drwxr-xr-x  2 root root   4096 Sep  3 17:56 ./
drwxr-xr-x 54 root root  36864 Oct 10 15:07 ../
-rw-r--r--  1 root root     31 Jun 19 04:54 ld.so.conf
lrwxrwxrwx  1 root root     12 Jun 19 04:54 libGL.so.1 -> libGL.so.1.2
-rw-r--r--  1 root root 390352 Jun 19 04:55 libGL.so.1.2
# 可以看到刚好没有libGL.so,就在 /usr/lib/x86_64-linux-gnu/mesa/ 目录下,建立一个指向libGL.so.1.2的软连接libGL.so即可
# 如果没有root权限,则可以在SDK的lib目录中建立软连接亦可,如下所示:
jay@jay-linux:~$ ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2 /home/jay/adt-bundle-linux-x86_64-20130917/sdk/tools/lib/libGL.so

在eclipse中并不能直接开发android程序,需要一个ADT插件,但在64位Ubuntu上,Eclipse中使用ADT时,提示R找不到“R cannot be resolved to a variable”错误,如何解决呢?

在64位Ubuntu上,Eclipse中使用ADT查看Andorid App 代码时,发现很多都时红的(错误),提示为R找不到“R cannot be resolved to a variable”。

我们都知道R.java时自动生成的,通过R可以引用App中的resource。

同时,仔细一看,在gen/my.package/下并没有自动生成R.java文件。

其原因,应该是自动生成R.java的工具的运行需要32bit的一些库,而在64bit系统上默认可能缺少这些库。

解决方案也很简单,直接安装所需的库即可,例如在Ubuntu上:

 代码如下 复制代码
jay@jay-linux:~$ sudo apt-get install ia32-libs



安装好32bit的库后,刷新项目或重启Eclipse后,就正常了。

[!--infotagslink--]

相关文章

  • php错误提示 open_basedir restriction in effect 解决

    今天在帮助一个朋友配置一台服务器时发现网站配置好了缓存目录读写不成功,在打开错误时发现提示 Warning: file_exists() [function.file-exists]: open_basedir restr...2016-11-25
  • 解决:failed to open stream: No such file or directory in

    本教程来给各位同学介绍failed to open stream: No such file or directory in解决办法,有需要了解的朋友可进入参考。 Warning: include_once(./include/main.i...2016-11-25
  • Android子控件超出父控件的范围显示出来方法

    下面我们来看一篇关于Android子控件超出父控件的范围显示出来方法,希望这篇文章能够帮助到各位朋友,有碰到此问题的朋友可以进来看看哦。 <RelativeLayout xmlns:an...2016-10-02
  • Android开发中findViewById()函数用法与简化

    findViewById方法在android开发中是获取页面控件的值了,有没有发现我们一个页面控件多了会反复研究写findViewById呢,下面我们一起来看它的简化方法。 Android中Fin...2016-09-20
  • Android模拟器上模拟来电和短信配置

    如果我们的项目需要做来电及短信的功能,那么我们就得在Android模拟器开发这些功能,本来就来告诉我们如何在Android模拟器上模拟来电及来短信的功能。 在Android模拟...2016-09-20
  • 夜神android模拟器设置代理的方法

    夜神android模拟器如何设置代理呢?对于这个问题其实操作起来是非常的简单,下面小编来为各位详细介绍夜神android模拟器设置代理的方法,希望例子能够帮助到各位。 app...2016-09-20
  • android自定义动态设置Button样式【很常用】

    为了增强android应用的用户体验,我们可以在一些Button按钮上自定义动态的设置一些样式,比如交互时改变字体、颜色、背景图等。 今天来看一个通过重写Button来动态实...2016-09-20
  • 解决Antd Table表头加Icon和气泡提示的坑

    这篇文章主要介绍了解决Antd Table表头加Icon和气泡提示的坑,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-11-17
  • Android WebView加载html5页面实例教程

    如果我们要在Android应用APP中加载html5页面,我们可以使用WebView,本文我们分享两个WebView加载html5页面实例应用。 实例一:WebView加载html5实现炫酷引导页面大多...2016-09-20
  • 深入理解Android中View和ViewGroup

    深入理解Android中View和ViewGroup从组成架构上看,似乎ViewGroup在View之上,View需要继承ViewGroup,但实际上不是这样的。View是基类,ViewGroup是它的子类。本教程我们深...2016-09-20
  • Android自定义WebView网络视频播放控件例子

    下面我们来看一篇关于Android自定义WebView网络视频播放控件开发例子,这个文章写得非常的不错下面给各位共享一下吧。 因为业务需要,以下代码均以Youtube网站在线视...2016-10-02
  • Android用MemoryFile文件类读写进行性能优化

    java开发的Android应用,性能一直是一个大问题,,或许是Java语言本身比较消耗内存。本文我们来谈谈Android 性能优化之MemoryFile文件读写。 Android匿名共享内存对外A...2016-09-20
  • Android设置TextView竖着显示实例

    TextView默认是横着显示了,今天我们一起来看看Android设置TextView竖着显示如何来实现吧,今天我们就一起来看看操作细节,具体的如下所示。 在开发Android程序的时候,...2016-10-02
  • mysql提示Changed limits: max_open_files: 2048 max_connections: 1910 table_cache: 64的解决

    在windows下安装Mysql系统日志出现max_open_files: 2048 max_connections: 510 table_cache: 764 类似错误是因为 max_connections 最大连接数和max_open_files、table_cache 不匹配。适当的降低max_connections 或调...2014-05-31
  • android.os.BinderProxy cannot be cast to com解决办法

    本文章来给大家介绍关于android.os.BinderProxy cannot be cast to com解决办法,希望此文章对各位有帮助呀。 Android在绑定服务的时候出现java.lang.ClassCastExc...2016-09-20
  • Android 实现钉钉自动打卡功能

    这篇文章主要介绍了Android 实现钉钉自动打卡功能的步骤,帮助大家更好的理解和学习使用Android,感兴趣的朋友可以了解下...2021-03-15
  • Android 开发之布局细节对比:RTL模式

    下面我们来看一篇关于Android 开发之布局细节对比:RTL模式 ,希望这篇文章对各位同学会带来帮助,具体的细节如下介绍。 前言 讲真,好久没写博客了,2016都过了一半了,赶紧...2016-10-02
  • Android中使用SDcard进行文件的读取方法

    首先如果要在程序中使用sdcard进行存储,我们必须要在AndroidManifset.xml文件进行下面的权限设置: 在AndroidManifest.xml中加入访问SDCard的权限如下: <!--...2016-09-20
  • Android开发之PhoneGap打包及错误解决办法

    下面来给各位简单的介绍一下关于Android开发之PhoneGap打包及错误解决办法,希望碰到此类问题的同学可进入参考一下哦。 在我安装、配置好PhoneGap项目的所有依赖...2016-09-20
  • 用Intel HAXM给Android模拟器Emulator加速

    Android 模拟器 Emulator 速度真心不给力,, 现在我们来介绍使用 Intel HAXM 技术为 Android 模拟器加速,使模拟器运行度与真机比肩。 周末试玩了一下在Eclipse中使...2016-09-20