将eclipse项目转移到androidstudio后遇到的错误




1.

问题:9图会报错将9图的后缀改掉。

解决方法:修改成png就可以了。



2.

问题:Android Studio正式版签名的时候出现:Android xxx is not translated in zh。

解决方法:强制不翻译。转自:http://blog.csdn.net/u014083596/article/details/45191943


<resources
  xmlns:tools="http://schemas.android.com/tools"
  tools:ignore="MissingTranslation" >
</resources>




3.

问题:the same input jar is specified twice

解决方法:链接:http://www.xiaoyunduo.org/article/236/

在所有的-libraryjars 前插入 # 成 #-libraryjars xxxx.jar
原因分析,可能是高版本的 sdk 通过 proguard 混淆代码时默认已经将 lib目录中的 jar 都已经添加到打包脚本中,所以不需要再次手动添加。



4.

问题:如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k

解决方法:转自:http://www.cnblogs.com/zhaoyanjun/p/5390690.html

三:分割 Dex 文件实现方法 

     1、相关链接

     https://developer.android.com/tools/building/multidex.html#about

     2、在app的 build.gradle 中

         (1)在dependencies 中添加  

                compile 'com.android.support:multidex:1.0.1'

         (2)在 defaultConfig 中添加

                multiDexEnabled true

                     比如   

复制代码
1  defaultConfig {
2         applicationId "com.pegasus.map"
3         minSdkVersion 15
4         targetSdkVersion 23
5         versionCode 1
6         versionName "1.0"
7         signingConfig signingConfigs.config
8         multiDexEnabled true
9     }
复制代码

         (3)在 AndroidManifest.xml 中的  application 标签中添加             

复制代码
1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3     package="com.example.android.multidex.myapplication">
4     <application
5         ...
6         android:name="android.support.multidex.MultiDexApplication">
7         ...
8     </application>
9 </manifest>
复制代码

   提示:如果你的应用程序继承 Application , 那么你需要重写     

1 @Override
2     protected void attachBaseContext(Context base) {
3         super.attachBaseContext(base);
4         MultiDex.install(this) ;
5     }




5.

问题:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> java.lang.OutOfMemoryError: GC overhead limit exceeded

解决方法:链接:http://stackoverflow.com/questions/35034830/android-studio-gc-overhead-limit-exceeded

dexOptions {
    javaMaxHeapSize "4g"
}
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.xxxxx.android"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 8
        versionName "1.3"
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}



6.

问题:android studio 非法字符: \65279如何解决

解决方法

在刚刚从eclipse转到使用studio经常会遇到这个问题
解决方法,下载一个Notepad++,然后将格式错误的那个类用Notepad++打开,在Notepad++中格式里保存为无bom编码 格式。然后再去studio里make一下就可以了



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值