搜索
您的当前位置:首页正文

as 上导入将eclipse项目导入成module遇到的一些问题

来源:哗拓教育

根据错误提示可以看到couldn't find "libutility.so"找不到。
解决办法删除了一个so文件夹

图片来源于网络
关于so文件夹的作用可以看看这个链接

Bug No.5
Attribute "xxx" has already been defined
原因是在定义属性时,两个属性集里定义了两个相同的属性。

<? xml version = "1.0" encoding = "utf-8" ?>  
< resources >  
     < declare-styleable name= "PreferenceHeader" >  
        <!-- Identifier value for the header. -->  
        < attr name= "id" format = "integer"/>  
        < attr name= "icon" format = "integer" />  
        <!-- The fragment that is displayed when the user selects this item. -->  
    </declare-styleable >  
    < declare-styleable name= "Preference" >  
        < attr name= "icon" format = "integer" />  
        <!-- The key to store the Preference value. -->  
        < attr name= "key" format = "string" />  
    </declare-styleable >  
</ resources >  

icon属性被重复定义
解决办法
在属性集外面申明一下被重复的属性
< attr name = "icon" format = "integer" />

Bug No.6
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/xxxx/xxxx/device/xxxxx.class
出现这个问题跟前面差不多,在执行代码class合并时出现类或者jar重复,我的原因是两个项目都含有相同类,且包名也是一模一样。
解决办法: 把其中一个包的包名更改了, 当然你也可以抽取一个单独的base module。

Bug No.7
项目安装到手机同时出现了四个图标,原因是library里面的清单文件含有下面的代码

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

这个细想其实很好理解,提示LAUNCHER

Top