简体   繁体   中英

Implemented AppCompat library not found in my own android library dependency

I have created xten-framework Android dependency library into maven repository with dependency implementation of appcompat, RecyclerView and design library. It working well, no any issue when I build and run it using module project in dependencies.

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.xtensolutions.country:country-sdk:1.0.1'
    implementation project(':xten-framework')
}    

After deployed on maven repository, I have removed implementation project(':xten-framework') from dependency and added implementation 'com.xtensolution.support:xten-framework:1.0.0' in build.gradle

repositories {
    maven {
        url 'https://dl.bintray.com/myusername/maven/'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.xtensolutions.country:country-sdk:1.0.1'
    implementation 'com.xtensolution.support:xten-framework:1.0.0'
}

When I compile my project, I got the error that package android.support.v7.app.AppCompatActivity not exists

I can't understand, why support appcomapat package not found in my own library, when other created class is found of my library. where I am going to mistake to developed a library project with appcompat support? what I miss to add?

I am very thankful if anyone will give me the right solution to resolved this issue

In your library, if you're using the following dependency:

dependencies {
     implementation 'com.android.support:appcompat-v7:25.2.0'
}

When you using the library for your another project, the project won't see the support:appcompat because it is not exposed to your project. So, you need to add the support:appcompat to your app module.

Or use api instead of implementation in your library, like the following:

dependencies {
     api 'com.android.support:appcompat-v7:25.2.0'
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM