Issue
I am not able to use resourse "net.londatiga.android.R.drawable.menu_down_arrow" file from "NewQuickAction3D" library in heir library called "AndroidXXXLib", but other classes I am able to use.
I get an error during gradle build "error: package net.londatiga.android.R does not exist". How can I fix build scripts to have ability of use "net.londatiga.android.R" in my heir library?
The main goal is be able to use android resources from parent library inside heir library.
There are dependencies between projects:
- AndroidXXXDemo
- AndroidXXXLib
- DragSortListView
- NewQuickAction3D
- AndroidXXXLib
settings.gradle file in root folder contains:
include ':libraries:DragSortListView:DragSortListViewLib'
include ':libraries:NewQuickAction3D:NewQuickAction3DLib'
include ':AndroidXXXLib'
include ':AndroidXXXDemo'
It is build.gradle inside AndroidXXXLib:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
apply plugin: 'android-library'
apply plugin: 'idea'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':libraries:DragSortListView:DragSortListViewLib')
compile project(':libraries:NewQuickAction3D:NewQuickAction3DLib')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.android.support:support-v4:19.0.+'
compile 'net.simonvt.menudrawer:menudrawer:3.0.+@aar'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
}
idea project looks like:
Solution
Issue resolved.
Build tool merge all resources, that's why main R file of my heir library has to be used instead of "net.londatiga.android.R".
Note: Also need to make sure that there are no identical layout names in projects resources to avoid errors related to missing view ids (Priority Order for Library Dependencies)
Answered By - IgorOK
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.