Showing posts with label Android Issues. Show all posts
Showing posts with label Android Issues. Show all posts

Tuesday, 22 November 2016

Recyclerview inside scrollview not scrolling smoothly

18:52:00 Posted by Kumanan , , ,
RecyclerView v = (RecyclerView) findViewById(...);
v.setNestedScrollingEnabled(false);

As an alternative, you can modify your layout using the support design library. I guess your current layout is something like:

<ScrollView >
    <LinearLayout >
       <View > <!-- upper content -->
            <RecyclerView > <!-- with custom layoutmanager -->
    </LinearLayout >
</ScrollView >

Error : Library projects cannot set applicationId. applicationId is set to 'com.sample.example' in default config.

16:26:00 Posted by Kumanan , ,

ApplicationId in Library Projects :-

You cannot use applicationId to customize the package of a library project. The package name has to be fixed in library projects (and specified as packageName in the manifest). The Gradle plugin did not enforce this restriction earlier.

Removing applicationId variable from the library's build.gradle file should resolve the issue.

Tuesday, 4 October 2016

Error:The number of method references in a .dex file cannot exceed 64K

10:30:00 Posted by Kumanan
android {
    compileSdkVersion 23
    buildToolsVersion "24.0.0 rc2"

    defaultConfig {
        applicationId "com.try.app"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }



Monday, 18 April 2016

Gradle Issue : Process finished with non-zero exit value 2

10:20:00 Posted by Kumanan , ,
Click here

This issue is quite possibly due to exceeding the 65K methods dex limit imposed by Android. This problem can be solved either by cleaning the project, and removing some unused libraries and methods from dependencies in build.gradle, OR by adding multidex support.

So, If you have to keep libraries and methods, then you can enable multi dex support by declaring it in the gradle config.

defaultConfig {        
    // Enabling multidex support.
    multiDexEnabled true
}

Gradle Issue : Manifest merger failed when importing library project

10:19:00 Posted by Kumanan , ,
It seems to be the fault of the mainfest Merger tool for gradle.

Solved it by adding to my manifest tag xmlns:tools="http://schemas.android.com/tools"

Then added tools:replace="android:icon,android:theme" to the application tag

This tells the merger to use my manifest icon and theme and not of other libraries


Example:-

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"  // add tools line here 
    package="yourpackage">


    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:icon"> ///add this line 

.....

</application>

</manifest>

Hope it helps thanks

Monday, 7 March 2016

Tuesday, 17 February 2015

android duplicate files copied in apk meta-inf/notice.txt

12:49:00 Posted by Kumanan ,

The DSL to exclude files is:

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

You can add as many exclude statement as you want. The value is the archive path. No wildcard or glob support yet.

Note:-
You can add many statement like below.

packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }

Android Studio - gradle dsl method not found packagingoptions

12:30:00 Posted by Kumanan ,
Check the bundle.gradle file whether  it contains the following code snippet.

packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }

Complete bundle.gradle file looks like the below snippet.


apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.rabbitmq:rabbitmq-client:1.3.0'

}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.kums.thingsworked"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}


Thursday, 5 February 2015

Android - RequestFeature Error

16:32:00 Posted by Kumanan
android.util.AndroidRuntimeException: requestFeature() must be called before adding content

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.mainmenu);


You should call window request before calling super.onCreate(), which is shown below,

@Override
public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mainmenu);
}

Wednesday, 14 January 2015

Tuesday, 13 January 2015

Unable to load annotation processor factory 'compile-libs/androidannotations-2.7.1.jar' for project

12:00:00 Posted by Kumanan
Hi Friends,

I have faced this problem after checking out the project from SVN. The problem was it can't find the android annotations jar file.

You can fix this by going to Project Properties, selecting Java Compiler and expanding the Annotation Processing item. You can then remove and re-add the appropriate jar file under the Factory Path.

Once I did this, then the project built without any problems.