Android Library Manifest vs. App Manifest

Using a Library Project means that my overall project will have two manifests — one for the library and the other for the “main” app project — and I’m not clear what goes in which or if there is some redundancy. The library project manifest is not presently used. Gradle for Android, and therefore Android … Read more

Imported module in Android Studio can’t find imported class

First of all, you must import your library project by following that path: File –> New –> Import Module After you have imported the library project successfully, you must check your build.gradle file inside your project’s folder if the following line is present at the “dependencies” section: implementation project(‘:NameOfTheLibProject’) Then your project must be built … Read more

Retrofit 2 example tutorial but GsonConverterFactory display error “Cannot resolve symbol”

EDIT retrofit 2 is now stable. Use compile ‘com.squareup.retrofit2:retrofit:2.3.0’ compile ‘com.squareup.retrofit2:converter-gson:2.3.0’ in your build.gradle dependency section old answer with Retrofit 2.0 you have to declare in your build.gradle the convert factory you want to use. Add compile ‘com.squareup.retrofit:converter-gson:2.0.0-beta2’ to your gradle and sync it again

Using an Android library project Activity within another project

I believe you must include the <activity> in your own AndroidManifest.xml — I don’t think it gets picked up from a library. I don’t have my reference for that handy. Update: It’s official solution. From the doc: Declaring library components in the manifest file In the manifest file of the application project, you must add … Read more

Using the new “manifestmerger” property in Android

Add the following line to your project.properties file of your application project. manifestmerger.enabled=true Introduced with Android SDK Tools, Revision 20 (June 2012): https://developer.android.com/studio/releases/sdk-tools Build System     * Added automatic merging of library project manifest files into the including project’s manifest.       Enable this feature with the manifestmerger.enabled property.

Does an Android Library need a manifest ,app_name,Icon?

Any android library needs to have an AndroidManifest.xml file, but a name or an icon is not required. It’s only needed when there is an activity that is MAIN and LAUNCHER. You simply could use this manifest and your library will work like a charm. <?xml version=”1.0″ encoding=”utf-8″?> <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”[your package]” android:versionCode=”1″ android:versionName=”1.0″ > … Read more