I have read carefully: https://developer.android.com/studio/build/multidex.html#mdex-gradle
So I have added to my build.gradle:
compile 'com.android.support:multidex:1.0.1'
My application definition in Android.manifest:
android:name=".App"
Finally, App class is defined as follows:
public class App extends Application
{
private static Context mContext;
#Override
protected void attachBaseContext(Context base)
{
super.attachBaseContext(base);
MultiDex.install(this);
}
#Override
public void onCreate()
{
super.onCreate();
mContext = this;
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
.defaultDisplayImageOptions(new DisplayImageOptions.Builder()
.imageScaleType(ImageScaleType.EXACTLY)
.build())
.build();
ImageLoader.getInstance().init(config);
}
public static Context getContext()
{
return mContext;
}
}
Unfortunately, this definitely don't help. My app still crashes on KitKat, with following message:
java.lang.RuntimeException: Unable to instantiate application
com.example.App: java.lang.ClassNotFoundException: Didn't find class
"com.example.App"
I did everything suggested by Google. Also tried to extend MultiDexApplication, still the same.
Do you have any ideas what else can I try?
[edit]
My build.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
general {
keyAlias 'key'
keyPassword '123abc'
storeFile file('../store.jks')
storePassword '123abc'
}
}
compileSdkVersion 25
buildToolsVersion '26.0.0'
defaultConfig {
applicationId "(removed)"
minSdkVersion 19
targetSdkVersion 25
dataBinding.enabled = true
multiDexEnabled = true
versionCode 21
versionName '2.2'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
incremental true
targetCompatibility 1.8
sourceCompatibility 1.8
}
dexOptions {
javaMaxHeapSize '4096m'
}
lintOptions {
tasks.lint.enabled = false
}
productFlavors {
general {
applicationId "(removed)"
signingConfig signingConfigs.general
}
lomza {
applicationId "(removed)"
signingConfig signingConfigs.general
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:customtabs:25.4.0'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.yarolegovich:lovely-dialog:1.0.5'
compile 'com.kaopiz:kprogresshud:1.0.5'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.android.gms:play-services-places:10.2.1'
compile 'com.github.jaydeepw:poly-picker:v1.0.22'
compile 'com.android.support:support-v13:25.4.0'
compile 'gun0912.ted:tedpermission:1.0.3'
compile 'io.tus.android.client:tus-android-client:0.1.4'
compile 'io.tus.java.client:tus-java-client:0.3.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-vector-drawable:25.4.0'
compile 'com.google.firebase:firebase-crash:10.2.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'org.greenrobot:eventbus:3.0.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.google.guava:guava-collections:r03'
compile 'com.jcodecraeer:xrecyclerview:1.3.2'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.hendraanggrian:collapsingtoolbarlayout-subtitle:0.7.0'
compile 'io.reactivex.rxjava2:rxjava:2.0.2'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'
Android manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="(removed)">
<uses-feature android:name="android.hardware.camera"/>
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:fullBackupContent="#xml/backup_descriptor">
<!-- [START fcm_default_icon] -->
<!--
Set custom default icon. This is used when no icon is set for incoming notification messages.
-->
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#mipmap/ic_launcher"/>
<!--
Set color used with incoming notification messages. This is used when no color is set for the incoming
notification message.
-->
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="#color/colorAccent"/>
<!-- [END fcm_default_icon] -->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
<activity
android:name=".SplashActivity"
android:label="#string/app_name"
android:noHistory="true"
android:theme="#style/Theme.AppCompat.Light.NoActionBar.FullScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="SHOW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.app.shortcuts"
android:resource="#xml/shortcuts" />
</activity>
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:launchMode="singleTop"
android:theme="#style/AppTheme.NoActionBar">
</activity>
<activity android:name=".LoginActivity">
<!-- android:noHistory="true" -->
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="(removed)"/>
<activity
android:name=".DetailsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/activity_details"
android:launchMode="singleTop"
android:parentActivityName=".MainActivity">
</activity>
<activity
android:name=".MapActivity"
android:label="#string/activity_map"
android:parentActivityName=".DetailsActivity">
</activity>
<activity
android:name=".AddEventActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/activity_add_event"
android:launchMode="singleTop"
android:parentActivityName=".MainActivity">
</activity>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"/>
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="#string/fb_login_protocol_scheme"/>
</intent-filter>
</activity>
<service
android:name=".Tus.TusUploadService"
android:exported="false"/>
<!-- [START firebase_service] -->
<service android:name=".Firebase.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<!-- [END firebase_service] -->
<!-- [START firebase_iid_service] -->
<service android:name=".Firebase.MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<!-- [END firebase_iid_service] -->
<activity
android:name=".Preferences.SettingsActivity"
android:label="#string/title_activity_settings"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="(removed).MainActivity"/>
</activity>
<activity
android:name="nl.changer.polypicker.ImagePickerActivity"
android:label = "#string/activity_img_picker_title"
/>
<activity
android:name=".ImagePreviewActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/title_activity_image_preview"
android:parentActivityName=".DetailsActivity"
android:theme="#style/FullscreenTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="(removed).DetailsActivity"/>
</activity>
</application>
</manifest>
disables Instant Run.
Note :-> If your project is configured for multidex with minSdkVersion 20 or lower, and you deploy to target devices running Android 4.4 (API level 20) or lower, Android Studio disables Instant Run.
read more from doc
enable multidex as following:
android {
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
create one class like this
public class Multi_Dex extends Application {
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
now in your manifiest file add this
<application
android:name=".Multi_Dex"
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
Related
I am working on a version of an Android app and I would like to release a new update. The app compiles well, but when I try to generate a release apk or bundle, I always get the same Gradle errors that I cannot solve, as I don´t understand the problem. I have been wrapping my head around this for days, so I would be thankful for any help or hints.
This is the error log of the failing gradle task:
> Task :app:processReleaseMainManifest
/Users/dwa2112/Development/Template/Template/app/src/main/AndroidManifest.xml:31:5-235:19 Warning:
application#android:icon was tagged at AndroidManifest.xml:31 to replace other declarations but no other declaration present
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
/Users/dwa2112/Development/Template/Template/app/src/main/AndroidManifest.xml:57:9-67:20 Error:
android:exported needs to be explicitly specified for element <receiver#com.onesignal.GcmBroadcastReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
/Users/dwa2112/Development/Template/Template/app/src/main/AndroidManifest.xml:109:9-114:20 Error:
android:exported needs to be explicitly specified for element <receiver#com.onesignal.BootUpReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
/Users/dwa2112/Development/Template/Template/app/src/main/AndroidManifest.xml:115:9-119:20 Error:
android:exported needs to be explicitly specified for element <receiver#com.onesignal.UpgradeReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
This is my Android Manifest:
<?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.sherdle.universal">
<!-- Always Required to get content and check if internet is available -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Always Required for image coaching & maps -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- Required for notifications & radio -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Required for maps -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required for visualizer & radio -->
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- Required for tumblr -->
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<!-- Required for in-app purchases -->
<uses-permission android:name="com.android.vending.BILLING" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:icon">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<!-- Activities -->
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:exported="true"
android:label="#string/app_name"
android:theme="#style/AppTheme.Launcher"
tools:node="merge" />
<activity
android:name=".login.LoginActivity"
android:configChanges="orientation|screenSize"
android:exported="true"
android:label="#string/app_name"
android:theme="#style/AppTheme.Launcher"
tools:node="merge" />
<activity
android:name="com.onesignal.NotificationOpenedActivityHMS"
android:exported="false"
android:theme="#style/Theme.CanPostThis2.SplashTheme"
tools:replace="android:theme"
tools:node="merge" />
<activity
android:name=".SplashScreenActivity"
android:exported="true"
android:theme="#style/Theme.CanPostThis2.SplashTheme"
tools:node="merge">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".picer_lib.activity.ImagePickActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="#style/vw_FilePickerTheme"
tools:node="merge" />
<activity
android:name=".picer_lib.activity.ImageBrowserActivity"
android:exported="true"
android:hardwareAccelerated="false"
android:screenOrientation="portrait"
android:theme="#style/vw_FilePickerTheme"
tools:node="merge" />
<service
android:name=".Fcm.MyFirebaseMessagingService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".Fcm.GCMRegistrationIntentService"
android:exported="true"
tools:node="merge">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<activity
android:name=".picer_lib.activity.VideoPickActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="#style/vw_FilePickerTheme"
tools:node="merge" />
<activity
android:name=".picer_lib.activity.AudioPickActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="#style/vw_FilePickerTheme"
tools:node="merge" />
<activity
android:name=".picer_lib.activity.NormalFilePickActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="#style/vw_FilePickerTheme"
tools:node="merge" />
<activity android:name=".providers.rss.ui.RssDetailActivity" />
<activity android:name=".providers.videos.ui.VideoDetailActivity" />
<activity android:name=".providers.wordpress.ui.WordpressDetailActivity" />
<activity android:name=".providers.woocommerce.ui.ProductActivity" />
<activity
android:name=".comments.CommentsActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".HolderActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".attachmentviewer.ui.AttachmentActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".attachmentviewer.ui.AudioPlayerActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".attachmentviewer.ui.VideoPlayerActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".providers.woocommerce.ui.CheckoutActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".providers.woocommerce.ui.WooCommerceLoginActivity"
android:configChanges="orientation|screenSize"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".providers.videos.player.YouTubePlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="sensor"
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen" />
<!-- Services -->
<service
android:name=".providers.audio.player.player.PlaybackService"
android:exported="true"
tools:node="merge" />
<service android:name=".providers.radio.player.RadioService" />
<service android:name=".attachmentviewer.MusicService" />
<!--
A receiver that will receive media buttons and send as
intents to your MediaBrowserServiceCompat implementation.
Required on pre-Lollipop. More information at
http://developer.android.com/reference/android/support/v4/media/session/MediaButtonReceiver.html
-->
<receiver
android:name="androidx.media.session.MediaButtonReceiver"
android:exported="true"
tools:node="merge">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
<receiver
android:name=".providers.audio.player.media.MediaSessionReceiver"
android:exported="true"
tools:node="merge">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
<!--<receiver android:name=".providers.soundcloud.player.player.PlayerReceiver">
<intent-filter>
<action android:name="android.media.AUDIO_BECOMING_NOISY" />
</intent-filter>
</receiver>-->
<!-- Meta Data -->
<meta-data
android:name="com.onesignal.NotificationOpened.DEFAULT"
android:exported="true"
android:value="DISABLE"
tools:node="merge" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:exported="true"
android:value="#string/google_maps_key"
tools:node="merge" />
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:exported="true"
android:value="true"
tools:node="merge" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="true"
android:grantUriPermissions="true"
tools:node="merge">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths" />
</provider>
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="${applicationId}.firebaseinitprovider"
android:exported="false"
tools:node="remove" />
</application>
</manifest>
This is my build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
name 'Google'
}
google()
maven {
url 'https://jitpack.io'
}
}
}
buildscript {
ext.kotlin_version = '1.7.10'
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.jaredsburrows:gradle-license-plugin:0.8.80'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.14.0'
}
repositories {
google()
maven {
url 'https://plugins.gradle.org/m2/'
}
maven {
url 'https://maven.google.com/'
}
jcenter()
}
}
ext {
supportlib_version = '29.0.0'
gps_version = '[16.0.0, 17.0.0)'
fb_version = '[16.0.0, 18.0.0)'
}
allprojects {
repositories {
google()
jcenter()
}
}
This is my build.gradle for the module:
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'com.jaredsburrows.license'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
/*
* To update licenses, run:
* - cd [project location]
* - ./gradlew licenseReleaseReport
*/
licenseReport {
generateHtmlReport = true
generateJsonReport = false
// These options are ignored for Java projects
copyHtmlReportToAssets = true
copyJsonReportToAssets = false
}
android {
compileSdkVersion 33
defaultConfig {
applicationId "com.webagenten.canpostthis"
minSdkVersion 19
targetSdkVersion 33
multiDexEnabled true
versionCode 12
versionName "7.0"
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
//Optionally configure your OneSignal IDs below
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "",
onesignal_google_project_number: ""]
}
signingConfigs {
release {
storeFile file("")
storePassword ""
keyAlias ""
keyPassword ""
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
dexOptions {
jumboMode true
}
applicationVariants.all { variant ->
if (variant.buildType.name == 'release') {
variant.mergeAssets.doLast {
delete(fileTree(dir: variant.mergeAssets.outputDir, includes: ['x86/ffmpeg', '**/*.ffmpeg']))
}
}
variant.getRuntimeConfiguration().exclude group: 'com.google.code.findbugs', module: 'jsr305'
}
}
repositories {
flatDir {
dirs 'libs'
}
maven {
url "https://jitpack.io"
}
mavenCentral()
jcenter()
}
dependencies {
implementation 'com.devbrackets.android:exomedia:4.3.0' //TV
implementation 'com.google.android.exoplayer:exoplayer:2.18.2' //TV & Radio
implementation 'com.cleveroad:audiovisualization:1.0.1' //Radio
implementation 'com.google.code.gson:gson:2.8.9' //WC
implementation 'com.squareup.okhttp3:okhttp:3.12.1' //WC
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.google.firebase:firebase-analytics:21.2.0'
// Faceook SDK
implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.facebook.android:facebook-core:[4,5)'
implementation 'com.facebook.android:facebook-marketing:[4,5)'
implementation 'com.onesignal:OneSignal:[3.13.0, 3.99.99]'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.duolingo.open:rtl-viewpager:1.0.2'
implementation 'com.github.chrisbanes:PhotoView:1.3.0'
implementation 'com.github.ed-george:AndroidVimeoExtractor:1.2.1'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.multidex:multidex-instrumentation:2.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
implementation 'androidx.media:media:1.2.1'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.google.android.gms:play-services-ads:19.0.1'
implementation "com.google.android.gms:play-services-maps:17.0.0"
implementation 'com.google.android.material:material:1.3.0'
implementation "com.android.billingclient:billing:3.0.2"
implementation 'com.google.firebase:firebase-ads:19.0.1'
implementation 'com.google.firebase:firebase-analytics:18.0.2'
implementation 'com.google.firebase:firebase-crashlytics:17.3.1'
implementation 'com.google.firebase:firebase-messaging:21.0.1'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'androidx.fragment:fragment:1.1.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.onesignal:OneSignal:3.16.1'
implementation('com.squareup.picasso:picasso:2.71828') {
exclude group: "com.github.vansikrishna:Multimager:1.0.8", module: "jetified-Multimager-1.0.8-runtime"
}
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.duolingo.open:rtl-viewpager:1.0.2'
implementation 'com.github.chrisbanes:PhotoView:1.3.0'
implementation 'com.github.ed-george:AndroidVimeoExtractor:1.2.1'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.multidex:multidex-instrumentation:2.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.5'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
implementation 'androidx.media:media:1.6.0'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation project(path: ':imagepicker')
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.google.android.gms:play-services-ads:21.4.0'
implementation "com.google.android.gms:play-services-maps:18.1.0"
implementation 'com.google.android.material:material:1.7.0'
implementation "com.android.billingclient:billing:5.1.0"
implementation 'com.google.firebase:firebase-ads:21.4.0'
implementation 'com.google.firebase:firebase-analytics:21.2.0'
implementation 'com.google.firebase:firebase-crashlytics:18.3.2'
implementation 'com.google.firebase:firebase-messaging:23.1.1'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'androidx.fragment:fragment:1.5.5'
debugImplementation 'androidx.fragment:fragment-testing:1.5.5'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.crystal:crystalrangeseekbar:1.1.3'
implementation 'com.github.vansikrishna:Multimager:1.0.8'
implementation 'com.google.android.gms:play-services-ads:21.4.0'
implementation 'mobi.upod:time-duration-picker:1.1.3'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-analytics:21.2.0'
//implementation 'com.arthenica:mobile-ffmpeg-full:4.2.2.LTS'
implementation 'com.arthenica:mobile-ffmpeg-full-gpl:4.2.2.LTS'
}
I would appreciate any hints or help, as I simply don´t understand what´s wrong here, as the mentioned receivers in the error log are simply not part of the manifest.
I tried integrating google maps API in my android application but I keep getting a blank grey screen. Attaching manifest and build.gradle file. The activity file contains the default code that comes while creating a google maps activity. You can clearly see this in manifest file.
I have mentioned the API key. I think the issue lies in dependencies, I might not have included every library that requires in order to run the app but I am not able to figure it out.
Android Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mppolice">
<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.READ_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/Theme.MPPolice">
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow the directions here:
https://developers.google.com/maps/documentation/android-sdk/get-api-key
Once you have your API key (it starts with "AIza"), define a new property in your
project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace the
"YOUR_API_KEY" string in this file with "${MAPS_API_KEY}".
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY"/>
<activity
android:name=".NearbyPolice"
android:exported="false"/>
<activity
android:name=".More"
android:exported="false" />
<activity
android:name=".WomanHelpline"
android:exported="false" />
<activity
android:name=".Statistics"
android:exported="false" />
<activity
android:name=".MissingPerson"
android:exported="false" />
<activity
android:name=".NearbyOffenders"
android:exported="false" />
<activity
android:name=".Contacts"
android:exported="false" />
<activity
android:name=".CrimeReport"
android:exported="false" />
<activity
android:name=".PasswordActivity"
android:exported="false" />
<activity
android:name=".AuthScreen"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="false"
android:label="#string/title_activity_main"
android:theme="#style/Theme.MPPolice.NoActionBar" />
<activity
android:name=".SplashScreen"
android:exported="true"
android:theme="#style/Theme.MPPolice.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Build.gradle
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
}
apply plugin: 'com.google.gms.google-services'
android {
compileSdk 31
defaultConfig {
applicationId "com.example.mppolice"
minSdk 21
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_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation "androidx.cardview:cardview:1.0.0"
}
dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
implementation 'com.google.firebase:firebase-auth:21.0.7'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.android.gms:play-services-location:20.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:30.3.1')
implementation 'com.google.firebase:firebase-analytics'
}
I developed an app and delete Junit tests implementation from my gradle file to remove the tests package. I'm not sure if was after that, but since, android studio doesn't install one, but four times my app, all are the same.
This is my AndroidManifest.xml
<?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="braziliancard.veraodedescontos_lojista">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:theme="#style/AppTheme"
android:allowBackup="true"
android:debuggable="true"
tools:ignore="HardcodedDebugMode">
<activity android:name=".SplashScreenActivity"
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=".MainActivity" 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=".LoginLojista" 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=".utils.ToolbarCaptureActivity" android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
</manifest>
This is a screenshot of what is happening:
this is my gradle.file (app) file:
buildscript {
repositories {
google()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.4.0'
}
}
apply plugin: 'com.android.application'
android {
//compileSdkVersion project.androidTargetSdk
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
def validConfig
def keystoreFile
def keystorePassword
def keystoreAlias
try {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
keystoreFile = properties.getProperty('keystore.file')
keystorePassword = properties.getProperty('keystore.password')
keystoreAlias = properties.getProperty('keystore.alias')
validConfig = keystoreFile != null && keystorePassword != null && keystoreAlias != null;
} catch (error) {
validConfig = false
}
if (validConfig) {
System.out.println("Release signing configured with " + keystoreFile)
signingConfigs {
release {
storeFile project.rootProject.file(keystoreFile)
storePassword keystorePassword
keyAlias keystoreAlias
keyPassword keystorePassword
}
}
} else {
System.out.println("Specify keystore.file, keystore.alias and keystore.password in local.properties to enable release signing.")
}
buildTypes {
release {
if (validConfig) {
signingConfig signingConfigs.release
}
debug {
debuggable true
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.zxing:core:3.3.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26'
implementation 'com.android.support:preference-v14:26+'
implementation 'com.android.support:support-v13:26+'
implementation 'com.burgstaller:okhttp-digest:1.17'
implementation 'net.sourceforge.jtds:jtds:1.3.1'
implementation 'com.sunmi:sunmiui:latest.release'
// implementation 'javax.mail:1.4.7'
implementation 'com.android.support:appcompat-v7:26+'
implementation 'com.android.support:design:26+'
implementation 'com.android.support:recyclerview-v7:26+'
implementation 'com.sun.mail:android-mail:1.6.2'
implementation 'com.sun.mail:android-activation:1.6.2'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5'
// releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
implementation files('/lib/commons-email-1.5.jar')
implementation project(':zxing-android-embedded')
implementation files('/lib/additionnal.jar')
}
I copied the java folder, the layouts, and the AndroidManifest into another app who was working fine, but the android studio still install more than one time the app.
i guess is something about android manifest or gradle, but i have no idea of what. some tips?
You have the same number of shortcut as your number of launcher activities.
In most of the case, only one is needed
<?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="braziliancard.veraodedescontos_lojista">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:theme="#style/AppTheme"
android:allowBackup="true"
android:debuggable="true"
tools:ignore="HardcodedDebugMode">
<activity android:name=".SplashScreenActivity"
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=".MainActivity" android:theme="#style/AppTheme.NoActionBar"/>
<activity android:name=".LoginLojista" android:theme="#style/AppTheme.NoActionBar"/>
<activity android:name=".utils.ToolbarCaptureActivity" android:theme="#style/AppTheme.NoActionBar"/>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
</manifest>
I am developing an app for a long time and now I'm trying to install generated apk on my phone, but there is error occurs. But it works fine when I run it on emulator or wi-fi adb connection with the phone. I'm already read a lot of manuals, but nothing helps me yet. I have no slightest idea why it's happening.
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ru.scapegoats.checkers">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".activity.game.Game" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.bluetooth.BluetoothMenu" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.session.SessionActivity" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.createsession.CreateSessionActivity" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.internet.InternetMenu" />
</activity>
<activity android:name=".activity.properties.Properties" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.internet.InternetMenu" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.autorization.AutorizationActivity" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.registration.RegistrationActivity" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.main.Main" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.VIEW"/>
</intent-filter>
</activity>
</application>
</manifest>
Here is my build gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-P'
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "ru.scapegoats.checkers"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
checkReleaseBuilds false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
ext {
androidSupportVersion = "27.0.1"
gmsVersion = "12.0.1"
retrofitVersion = "2.1.0"
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('androidx.test.espresso:espresso-core:3.1.0-alpha2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.0.0-alpha3'
testCompile 'junit:junit:4.12'
implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
implementation "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
implementation "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}"
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.5.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
implementation 'com.google.android.material:material:1.0.0-alpha3'
}
I'm tried to run the app on different devices but error always the same.
add android:testOnly="false" and android:debuggable="true" in your manifest section
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:testOnly="false"
android:debuggable="true">
after this clean and Rebuild your project and try to install your apk again.
hope it will work..!! it works for me.
I had changed my LAUNCHER activity to exported=false by mistake. Then removed it and fixed :).
I changed complileSdkVersion to 28 and now it's installs fine.
Build -> Build Bundle (s) / APK (s) -> Build APK (s)
First of all I know there are many similar question, but my case is different. Please read the full question first!
This is the full error...
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/appindexing/Action$Builder$StatusType.class
Whenever I am trying to run in my emulator this error is showing.
Also if I try to generate .apk file (in debug or released mode), the same error is showing.
Now the magic...
If I run in my mobile phone in debug mode, it is totally ok. No errors are showing, it is running fine.
This is my manifest file...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.brandtechnosolutions.petbaazar">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#drawable/iconpetbazar"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.Light">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!--
ATTENTION: This was auto-generated to add Google Play services to your project for
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information.
-->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity android:name=".WebActivity" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<activity
android:name=".BuyerSellerActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".OptionActivity"
android:label="#string/title_activity_option"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".TakeAdInfoActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
</application>
</manifest>
My build.gradle...
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
dexOptions {
javaMaxHeapSize "1g"
}
repositories {
mavenCentral()
}
defaultConfig {
applicationId "com.brandtechnosolutions.petbaazar"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// apply plugin: 'com.google.gms.google-services'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-v4:25.1.0'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'junit:junit:4.12'
}
Using sdk platforms...
Gingerbread, Honeycomb, Marshmallow
Using emulator with Jelly Bean.
Anybody has any idea how to solve it, please help!
You should use the same level of libraries:
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
Also add at the buttom of the file:
apply plugin: 'com.google.gms.google-services'
EDIT:
To use the plugin you have to add the dependency in the buildscript block (in your top-level file or module file):
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
// ...
}