Alex009ru
Alex009ru

Reputation: 1

Use android support v7 library resources in my library

I want use android support v7 library's resource in my own library, i set

android.library.reference.1=../android-support-v7-appcompat

but when project build in gen folder not generating android.support.appcompat.R.java and i can't use resources. When i set android.library=false all build ok, file generating. but use this jar in another app project i can't:

[2013-11-03 13:49:23 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v7/appcompat/R$anim;
[2013-11-03 13:49:23 - MediaKuzbass] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v7/appcompat/R$anim;

Upvotes: 0

Views: 4867

Answers (2)

Giova
Giova

Reputation: 876

Set the same apptheme to both manifest .

Bad exemple :

Your lib :

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyThemeChildOfAppCompat" >

Your app :

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

You'll get the error.

Solution:

Your lib :

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyThemeChildOfAppCompat" >

Your app :

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/MyThemeChildOfAppCompat" >

Upvotes: 0

meredrica
meredrica

Reputation: 2563

You have the support-v7 lib twice on your project path, change that. Most likely the project you want to build and the different libraries you are using use different folders for the same appcompat lib.

Upvotes: 2

Related Questions