Eclipse工程导入Android Studio遇到的问题及解决方法

来源:互联网 发布:高性能linux服务器 编辑:程序博客网 时间:2024/05/17 01:53

1. 中文乱码问题

该问题一般是因为Eclipse工程采用的GBK编码, 而AndroidStudio采用UTF-8编码.

 

解决方法:

1. File ->Settings打开设置窗口

2. Editor-> File Encodings设置工程编码为GBK


 

3. GrandleScripts -> build.gradle (Module: app)

打开配置文件, 添加如下配置:

         /////////增加的内容,可以解决部署到设备上汉字显示乱码的问题
         /**/
         compileOptions {
             encoding"GBK"
         }

 

2. NDK错误

出现如下错误: Error:Execution failed for task

':app:transformNative_libsWithStripDebugSymbolForDebug'.

java.lang.NullPointerException (no errormessage)

 

该错误是一个BUG,解决方法是使用旧版本的grandlebuild tools.

 

1. Grandle Scripts-> build.gradle (Project: ...)

             修改gradle版本为: 2.2.0



2. GrandleScripts -> build.gradle (Module: app)

        修改buildToolsVersion版本为: 23.0.3

3. GrandleScripts -> local.properties (SDK Location)

注释掉: ndk.dir=D\:\\ProgramFiles\\Android\\sdk\\ndk-bundle