This is my code
int badgeCount = 3;
try {
Badges.setBadge(ProviderHomepage.this, badgeCount);
Log.d("BadgeSUCCESS", "BadgeSUCCESS");
} catch (BadgesNotSupportedException badgesNotSupportedException) {
Log.d("BadgeERROROROROROR", badgesNotSupportedException.getMessage());
}
Manifest file app icon is my icon of app
<application
android:icon="#drawable/logofour"
/>
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
useLibrary 'org.apache.http.legacy'
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.bindaspunch.my.bindaspunch"
minSdkVersion 13
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/anim'] } }
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile files('libs/simple-side-drawer2.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:23.4.0'
// compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.google.android.gms:play-services-maps:8.1.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'
compile 'com.android.support:design:23.4.0'
// compile 'com.google.android.gms:play-services:9.4.0'
compile files('libs/volley.jar')
// compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.4.0'
// compile files('libs/gcm.jar')
compile files('libs/gcm.jar')
compile 'com.android.support:support-v4:23.1.1'
// compile 'com.android.support:support-v4:21.0.3'
compile 'it.sephiroth.android.library.picasso:picasso:2.5.2.4b'
compile "com.squareup.picasso:picasso:2.4.0"
compile 'com.github.arturogutierrez:badges:1.0.5#aar'
}
The code Reference is
https://github.com/arturogutierrez/Badges
there is an error of having Current home "launcher is not supported by Badges library" in my logcat and i can't change the app icon;
the error remains when i remove app icon from Manifest class... what are the changes than..
i m trying this till Yesterday but it has issue and i can't use this code, kindely help me out of this issue...
sorry for my english and thnx in advance ...
Related
I am getting the error in the below code:
if (ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
}
The "checkSelfPermission" is always red indicating some kind of error.
I have imported "import android.support.v4.content.ContextCompat;" already.
The below is my build.gradle content:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.xyz.user.abc"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// testCompile 'junit:junit:4.12'
compile files('libs/volley.jar')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.google.android.gms:play-services:10.2.1'
compile 'com.android.support:design:25.3.0'
compile 'junit:junit:4.12'
// compile 'com.google.android.gms:play-services-appindexing:10.2.1'
// compile 'com.google.android.gms:play-services:9.8.0'
// compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.android.support:support-v4:25.3.0'
compile files('libs/android-support-v4.jar')
}
Any advice will be really appreciated.
I got no idea why this is not working. Kind of a noob at this.
Using PermissionChecker.checkSelfPermission instead of ContextCompat.checkSelfPermission corrects the above error.
https://android-arsenal.com/details/1/4136
not able to integrate this library
Stuck with this error - java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/os/BuildCompat;
here's my gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "matrixdev.com.waitel"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.cepheuen.elegant-number-button:lib:1.0.2'
compile('com.android.support:support-v4:23.3.0') {
force = true;
}
}
Have you tried removing the parenthesis for the last compile? like so:
compile 'com.android.support:support-v4:23.3.0'
instead of:
compile('com.android.support:support-v4:23.3.0')
this is my project build.gradle file .whenever i run the project in android studio i get the duplicate entry: android/support/v4/util/MapCollections$ArrayIterator.class error
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "com.aitsolution.bizitapp.bizit"
minSdkVersion 16
targetSdkVersion 23
versionCode 14
versionName "1.13"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
dexOptions {
javaMaxHeapSize "3g"
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
// compile fileTree(include: ['*.jar'], dir: 'libs')
// testCompile 'junit:junit:4.12'
compile files('libs/linkedin-j-android.jar')
compile files('libs/MobileOcrEngine.jar')
compile files('libs/signpost-core-1.2.1.1.jar')
compile files('libs/twitter4j-core-3.0.5.jar')
compile files('libs/ksoap2_2.6.0.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.android.gms:play-services-appindexing:9.0.0'
compile 'com.android.support:cardview-v7:23.3.+'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.edmodo:cropper:1.0.1'
}
I think facebook sdk comes with v4-support library exclude that and try.
compile ('com.facebook.android:facebook-android-sdk:4.6.0') {
exclude module: 'support-v4'
}
I got this below error in gradle build Messages
.I tried many Stackoverflow post relevant to this issue.But nothing worked for me.
Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry:
android/support/annotation/IntegerRes.class
Edit:
app/build.gradle:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.golive.vernon"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
//incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/NOTICE.txt' // will not include NOTICE file
exclude 'META-INF/LICENSE.txt' // will not include LICENSE file
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/gcm.jar')
compile files('libs/glide-3.6.1.jar')
compile files('libs/httpcore-4.3-beta1.jar')
compile files('libs/httpmime-4.3.jar')
compile files('libs/universal-image-loader-1.9.5.jar')
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile project(':facebook')
compile project(':InstaLibrary')
compile project(':simple-crop-image-lib')
compile files('libs/twitter4j-core-4.0.4.jar')
compile 'com.android.support:multidex:1.0.1'
}
Below I have added the libs screenshot:
Below I have added the dependencies list:
Manifest:
>
Appcontroller.java:
#Override
public void onCreate() {
super.onCreate();
MultiDex.install(this);
mInstance = this;
}
In your Gradle Compile with support:multidex and add also dexOptions
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
..............
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
//incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/NOTICE.txt' // will not include NOTICE file
exclude 'META-INF/LICENSE.txt' // will not include LICENSE file
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile files('libs/gcm.jar')
compile files('libs/glide-3.6.1.jar')
compile files('libs/httpcore-4.3-beta1.jar')
compile files('libs/httpmime-4.3.jar')
compile files('libs/universal-image-loader-1.9.5.jar')
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile project(':facebook')
compile project(':InstaLibrary')
compile project(':simple-crop-image-lib')
compile files('libs/twitter4j-core-4.0.4.jar')
compile 'com.android.support:multidex:1.0.1'
}
In Your AndroidManifest.xml add this lines android:name
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:name="android.support.multidex.MultiDexApplication"
>
If also an error than compile
compile 'com.google.android.gms:play-services:+'
Instead OF
compile 'com.google.android.gms:play-services-maps:8.4.0'
After followed Er. Arjun saini answer referred to adding multidex & licence and I have corrected adding facebook sdk to solve this issue:
previously, I had added the Facebook library by adding import module.
Wrong Way :
compile project(':facebook')
Right Way:
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
And also In top-level build.gradle:
allprojects {
repositories {
jcenter() // This is the default repo
mavenCentral() // This is the Maven Central repo
}
}
I have this error when I try to run my application.
Build is ok. Run makes errors.I tried to set multiDexEnable to true also butI still get the error..
This is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "it.prova.mine"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_7
}
}
repositories {
//mavenLocal()
mavenCentral()
}
dependencies {
//compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
//bug cardview
//vedi -> http://stackoverflow.com/questions/24455867/error-when- adding-cardview-to-layout
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
//Custom ProgressDialog
compile 'com.github.d-max:spots-dialog:0.4#aar'
//Url Encoder
compile 'org.droidparts:droidparts:2.9.1'
//SearchView
compile 'com.miguelcatalan:materialsearchview:1.3.1'
//Retrofit
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
//jackson-jsog extension
compile 'com.voodoodyne.jackson.jsog:jackson-jsog:1.1'
//
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.2'
compile 'com.google.code.gson:gson:2.6.2'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
//java.time backport
compile 'org.threeten:threetenbp:1.3.1'
//java.ws.rs.core
compile 'javax.ws.rs:jsr311-api:0.11'
//javax.xml.bind
compile 'javax.xml.bind:jaxb-api:2.1'
//javax.persistence
compile 'javax.persistence:persistence-api:1.0.2'
compile 'commons-codec:commons-codec:1.2'
//javax.json
compile 'org.glassfish:javax.json:1.0.4'
//jackson jsr310 plugin backport java7
compile 'com.github.joschi.jackson:jackson-datatype-threetenbp:2.4.4'
}
And this is the error:
Error
How can I do?
Thanks in advance