android文件复制

时间:2015-07-24 11:22:01

标签: android

在android studio.Am中导入我的eclipse项目时得到像这个LogCat的错误。

`错误:在打包APK C期间重复文件:\ Users \ sentientit \ Documents \ Wed Studio \ app \ build \ outputs \ apk \ app-debug-unaligned.apk

Path in archive: META-INF/LICENSE.txt

Origin 1: C:\Users\sentientit\Documents\Wed Studio\app\libs\twitter4j.jar

Origin 2: C:\Users\sentientit\.gradle\caches\modules-2\files-2.1\joda-time\joda-time\2.4\89e9725439adffbbd41c5f5c215c136082b34a7f\joda-time-2.4.jar

您可以忽略build.gradle中的那些文件:

android {
  packagingOptions {
    exclude 'META-INF/LICENSE.txt'
  }
}

错误:任务':app:packageDebug'执行失败。

  

在APK META-INF / LICENSE.txt中复制的重复文件       文件1:C:\ Users \ sentientit \ Documents \ Wed Studio \ app \ libs \ twitter4j.jar       文件2:C:\ Users \ sentientit.gradle \ caches \ modules-2 \ files-2.1 \ joda-time \ joda-time \ 2.4 \ 89e9725439adffbbd41c5f5c215c136082b34a7f \ joda-time-2.4.jar`

我已经删除了重复文件仍然出现错误,你告诉我解决它的正确方法

提前谢谢

07-24 17:22:14.789 29926-29926 / com.sentientit.theiWedplanner E / AndroidRuntime:FATAL EXCEPTION:main

java.lang.RuntimeException: Unable to start activity 

ComponentInfo {com.sentientit.theiWedplanner / com.sentientit.theiWedplanner.Frontpage}:android.view.InflateException:二进制XML文件行#10:错误膨胀类片段

        at 

android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)             在

android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2295)             在android.app.ActivityThread.access $ 700(ActivityThread.java:150)             在

android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1280)

        at android.os.Handler.dispatchMessage(Handler.java:99)

        at android.os.Looper.loop(Looper.java:175)

        at android.app.ActivityThread.main(ActivityThread.java:5279)

        at java.lang.reflect.Method.invokeNative(Native Method)

        at java.lang.reflect.Method.invoke(Method.java:511)
        at 

com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1102)

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)

        at dalvik.system.NativeStart.main(Native Method)



 Caused by: android.view.InflateException: Binary XML file line #10: Error 

膨胀类片段             在

android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:710)

        at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)

        at android.view.LayoutInflater.inflate(LayoutInflater.java:495)

        at android.view.LayoutInflater.inflate(LayoutInflater.java:397)

        at android.view.LayoutInflater.inflate(LayoutInflater.java:353)

        at 

com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:350)             在android.app.Activity.setContentView(Activity.java:1930)             在

com.sentientit.theiWedplanner.Frontpage.onCreate(Frontpage.java:50)

        at android.app.Activity.performCreate(Activity.java:5283)
        at 

android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)             在

android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209) 在

android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2295)

在android.app.ActivityThread.access $ 700(ActivityThread.java:150)

at

android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1280)

在android.os.Handler.dispatchMessage(Handler.java:99)

在android.os.Looper.loop(Looper.java:175)

在android.app.ActivityThread.main(ActivityThread.java:5279)

1 个答案:

答案 0 :(得分:1)

尝试添加此内容:

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'

    }
}