I am facing a strange problem in API level 22 (lollipop) mobiles.
Mobiles using these API levels are working fine
API 24
API 23
But when i run my app on API level 22 mobile, it gives me following error message.
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.squareup.picasso.Picasso"
on path: DexPathList[[zip file
"/data/app/com.myapp.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp.app-1/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
However this is not Picasso related problem, if i remove Picasso library it starts giving me error messages on other classes.
Process: com.myapp.app, PID: 16327
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/myapp/app/VideosListActivity
at com.myapp.app.MainActivity$8.onClick(MainActivity.java:422)
Gradle FIles (App)
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId 'com.myapp.app'
minSdkVersion 21
targetSdkVersion 24
versionCode 26
versionName "1.0"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86", "armeabi", "mips"
}
}
lintOptions {
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g"
jumboMode true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':common')
compile project(':commonwidget')
compile project(':videowidget')
compile 'com.android.support:multidex:1.0.1'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.okhttp:logging-interceptor:2.6.0'
compile 'org.glassfish:javax.annotation:10.0-b28'
compile 'io.card:android-sdk:5.4.0'
compile 'it.sephiroth.android.library.targettooltip:target-tooltip-library:1.3.15'
compile 'com.github.michaelye.easydialog:easydialog:1.4'
compile 'org.jsoup:jsoup:1.8.3'
compile 'me.grantland:autofittextview:0.2.+'
repositories {
flatDir {
dirs 'libs'
}
}
Gradle - Project
buildscript {
repositories {
jcenter()
}
dependencies {
/**/
/* classpath 'com.android.tools.build:gradle:1.2.3'*/
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.google.gms:google-services:2.1.0'
classpath 'com.google.code.gson:gson:2.2.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
android:name=".AnalyticsSampleApp"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<service android:name=".ticketing.services.LogoutService" />
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".MapsActivity"
android:label="#string/title_activity_maps">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SplashDefaultActivity" />
</activity>
<activity
android:name=".DirectionsActivity"
android:label="#string/title_activity_directions"
android:parentActivityName=".MapsActivity"
android:theme="#style/AppTheme.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SplashDefaultActivity" />
</activity>
<activity
android:name=".SplashDefaultActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SplashVideoActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name=".VideosListActivity"
android:configChanges="orientation|keyboardHidden"
android:label="#string/title_activity_videos_list"
android:screenOrientation="portrait"
android:theme="#style/AppTheme" />
<activity
android:name=".VideoActivity"
android:configChanges="orientation|screenSize"
android:label="#string/title_activity_video"
android:theme="#style/AppTheme" />
Did you manually re-sync gradle after your changes? Did you also change build-tools version in your build.gradle to match API 22 as well? The errors you're showing I've only seen when gradle hasn't rebuilt or resynced properly. I would also try to manually do it from the command line... (in OS X), ./gradlew clean, ./gradlew assemble
Related
Well, actually, I am a newbie to android. I have been trying to develop an app that has google maps, and everything was going fine until today when I got this error from the emulator.
Here are some files in case it may be helpful.
Manifest XML file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.uaproject">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.UAProject">
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".Hotels"
android:exported="true"
android:parentActivityName=".HomeScreen" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${MAPS_API_KEY}" />
<activity
android:name=".NoteEditorActivity"
android:exported="true"
android:parentActivityName=".HomeScreen" />
<activity
android:name=".AboutApp"
android:exported="true"
android:parentActivityName=".Menu" />
<activity
android:name=".Copyrights"
android:exported="true"
android:parentActivityName=".Menu" />
<activity
android:name=".ToAboutBayanOlgey"
android:exported="true"
android:parentActivityName=".Menu" />
<activity
android:name=".ToAboutUs"
android:exported="true"
android:parentActivityName=".Menu" />
<activity
android:name=".Menu"
android:exported="true"
android:parentActivityName=".HomeScreen" />
<activity
android:name=".HomeScreen"
android:exported="true" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
build.gradle-app level
plugins {
id 'com.android.application'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.example.uaproject"
minSdk 19
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.github.smarteist:autoimageslider:1.3.9'
implementation 'com.google.android.material:material:<version>'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
build.gradle-root level
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.1"
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
PS: By the way, if you guys have time, could you please guide me on how to add google maps to an already-created fragment(for example, my fragment is the one of a bottom navigation). I have been searching but all I tried did not work for some reason. Or just a link to the valid way would do because there seemed to be many obsolete approaches to this as well, which we beginners cannot really discern.
I am trying to build a what's app application but when I try to implement android image cropper in build.gradle it gave me some error like this
"ERROR: Failed to parse XML in
H:\Project\WhatsApp2\app\src\main\AndroidManifest.xml ParseError at
[row,col]:[17,9] Message: expected start or end tag Affected Modules:
app "
My code is given below
Android Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.whatsapp2">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
tools:replace="android:appComponentFactory"
<activity android:name=".PhoneLoginActivity"></activity>
<activity android:name=".GroupChatActivity" />
<activity android:name=".SettingsActivity" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity" />
<activity android:name=".RegisterActivity" />
</application>
</manifest>
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.whatsapp2"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
}
What should I do now?
For those, who still get an error even after adding dependency:
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
If your error may be something like:
Classes of CropImage Library were not auto suggested by IDE, then you must ensure this maven { url 'https://jitpack.io' } and jcenter() in your project level build.gradle file.
Like this:
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.google.gms:google-services:4.3.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
It must work in that scenario. Hope! it helps.
For Temporary solution you can downgrade version as below:
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
instead of
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
Note : This error is regarding android jetpacks that may be updated in library.
First convert your project into androidx by refactoring
Refactor-> Migrate to AndroidX -> Migrate
or add below lines in gradle.properties and manually change all widgets into androidx
android.useAndroidX=true
android.enableJetifier=true
And change this
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
into
api 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
You were missing a ">" closing tag, do it like :
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:appComponentFactory">
<activity android:name=".PhoneLoginActivity"/>
<activity android:name=".GroupChatActivity" />
<activity android:name=".SettingsActivity" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity" />
<activity android:name=".RegisterActivity" />
</application>
Update : As you see there is an error in you AndroidManifest.xml file stating :
expected start or end tag Affected Modules: app
If you using below version of library
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
Then please add this line to your Proguard config file(proguard-rules.pro) and check it once
-keep class androidx.appcompat.widget.** { *; }
and also remove tools:replace="android:appComponentFactory" from manifest file
which is outside of <application> tag
Recently this problem become very common when using android support library and third party libraries. Try migrating to androidX, it's pretty safe. And add:
android.useAndroidX=true
android.enableJetifier=true
in your gradle.properties which will automatically done if you migrate to androidX with android studio 3.2 plugin, to do this, go to refactor menu and choose migrate to androidX.
I am getting below Error while running my Application.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
I think the issue is with my .gradle file. Maybe some duplication for dependency in my .gradle file. I have removed one but, still getting the error.
My .gradle file is as below.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.mypackagename"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
compile 'com.google.android.gms:play-services:11.0.2'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.1'
testCompile 'junit:junit:4.12'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.android.support:cardview-v7:24.2.+'
compile 'com.google.code.gson:gson:2.6.1'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp:okhttp:2.6.0'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.2'
}
}
My Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mypackagename">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.roadysmart.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar"></activity>
<activity
android:name=".UserProfileEditActivity"
android:label="User Profile"
android:screenOrientation="portrait" />
<activity
android:name=".SignInActivity"
android:label="Sign In"
android:screenOrientation="portrait" />
<activity
android:name=".SelectActivity"
android:label="Were here to help"
android:screenOrientation="portrait" />
<activity
android:name=".SignUpActivity"
android:label="Sign Up"
android:screenOrientation="portrait" />
<activity
android:name=".ForgotPasswordActivity"
android:label="Forgot Password"
android:screenOrientation="portrait" />
<activity
android:name=".UserProfileActivity"
android:label="User Profile"
android:screenOrientation="portrait" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaS0000000014789occURS5KvtKgfdreWjaDI" />
</application>
Try adding multiDexEnabled true in defaultConfig.
Moreover, its not recommended to use com.google.android.gms:play-services:11.0.2 directly rather include the dependencies you want to work with separately. Like if you want to work with Google Maps, then add only com.google.android.gms:play-services-maps:11.1.0 and so on.
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
You've hit the dex limit for the number of methods that can be used in which affects all device lower than Android 5.0(21).
To fix this you need to enable multi-dex in your gradle and have your application extends MultiDexApplication to work around with the max Dex limit.
android {
defaultConfig {
...
minSdkVersion 21
targetSdkVersion 26
multiDexEnabled true
}
...
}
In my app, I use a library from an aar file. lets say library.aar
My app is called, "Awsome app", so I have a string value:
<string name="app_name" translatable="false">Awsome app</string>
But when I compile the app, the name in the mobilephone is "SDK", where this label is from the library.aar
strings.xml:
<string name="app_name" translatable="false">Awsome App</string>
Is there any way to avoid the library change my app name?
== EDIT ==
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xxx.xxx.AwsomeApp">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="xxx.xxx.AwsomeApp"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<meta-data
android:name="DATABASE"
android:value="app.db" />
<meta-data
android:name="VERSION"
android:value="1" />
<meta-data
android:name="QUERY_LOG"
android:value="false" />
<meta-data
android:name="DOMAIN_PACKAGE_NAME"
android:value="xxx.xxx.AwsomeApp" />
<activity
android:name="xxx.xxx.AwsomeApp.MainActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="xxx.xxx.AwsomeApp.SplashActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="xxx.xxx.AwsomeApp.LegalActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="xxx.xxx.AwsomeApp.LoginActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="xxx.xxx.AwsomeApp.QuizActivity"
android:label="#string/title_activity_quiz" />
<meta-data
android:name="io.fabric.ApiKey"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</application>
</manifest>
I add the gradle file to:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.20.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion '23.0.3'
productFlavors{
vanilla {
applicationId "xxx.xxx.AwsomeApp"
buildConfigField 'String','HOST_API', '"awsomeURL"'
}
bsa {
applicationId "xxx.xxx.AwsomeApp.bsa"
buildConfigField 'String','HOST_API', '"awsomeURL"'
}
}
defaultConfig {
applicationId "xxx.xxx.AwsomeApp"
minSdkVersion 15
targetSdkVersion 25
versionCode 8
versionName "1.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
flatDir {
dirs 'libs'
}
}
dependencies {
androidTestCompile 'com.android.support:support-annotations:25.0.1'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.github.satyan:sugar:1.4'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.3'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.problematiclibrary.sdk:sdk-release#aar' <<--- here is the libray (I dont put the real name, cause if from work)
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
}
Try to put App name direct as String in application tag. and show the output.
<application
android:name="xxx.xxx.AwsomeApp"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="Awsome App"
android:supportsRtl="true"
android:theme="#style/AppTheme">
Let me know after try this...
When i try to run the program, i get error exceeds 64k
I don't know how to solve this. I had already try the resolve but it still failed and give me more error. Please help me
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.timslbl.geogencybaru"
minSdkVersion 16
targetSdkVersion 23
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 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.roughike:bottom-bar:1.2.1'
compile 'com.google.http-client:google-http-client-android:+'
compile 'com.google.api-client:google-api-client-android:+'
compile 'com.google.api-client:google-api-client-gson:+'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.2.1'
}
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.timslbl.geogencybaru">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Required to show current location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<aplication
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="" />
<activity android:name=".MapActivity" />
<activity android:name=".MainActivity"></activity>
<activity android:name=".LoginActivity"></activity>
<activity android:name=".RegisterActivity"></activity>
</aplication>
</manifest>
This is the error that i got after try the resolve
I highly suggest not to compile compile 'com.google.android.gms:play-services:8.4.0'
as it is,
Which is one of the main cause of 64K method dex limit.
The separate compilations beyond play-services itself is listed Here, Use the one you really need rather than compiling the whole play-services.
Is your project a very large one? I'm suspecting that it may be going over the method limit of 64k. Have a look at this documentation. It may help.