I'm building an application that has a shared library and two applications that share this library.
As soon as the application starts the logcat shows D/AndroidRuntime: Shutting down VM.
If I debug the application it does not launch my MainActivity (LoginActivity). The application crashs after return from attachBaseContext(Context base) in the Application Class.
This is not a simple case of NPE, the problem is that the VM is Shutting down and the only debuggable part is the Global.attachBaseContext that runs OK and after that the Logcat message is shown.
LOGCAT
I/MultiDex: VM with version 2.1.0 has multidex support
I/MultiDex: install
I/MultiDex: VM has multidex support, MultiDex support library is disabled.
I/MultiDex: install
I/MultiDex: VM has multidex support, MultiDex support library is disabled.
D/AndroidRuntime: Shutting down VM
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: br.com.cfb.dogwalktracker_dogwalker, PID: 17406
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean
java.lang.String.equals(java.lang.Object)' on a null object reference at android.app.ActivityThread.installProvider(ActivityThread.java:5140)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
GradeBuild shared library
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
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:multidex:1.0.1'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v13:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.github.orangegangsters:swipy:1.2.0#aar'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.google.code.gson:gson:2.7'
compile 'org.parceler:parceler:1.0.1'
compile 'org.parceler:parceler-api:1.0.1'
compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-places:11.0.4'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
}
Gradebuild (from dog walker Application)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "br.com.cfb.dogwalktracker_dogwalker"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
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.google.android.gms:play-services:11.0.4'
compile 'com.android.support:multidex:1.0.1'
})
compile project(':DogWalkTrackerShared')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.android.gms:play-services-plus:11.0.4'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
GradeBuild (From user Application)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "br.com.cfb.dogwalktrackeruser"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
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:multidex:1.0.1'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v13:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.github.orangegangsters:swipy:1.2.0#aar'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.google.code.gson:gson:2.7'
compile 'org.parceler:parceler:1.0.1'
compile 'org.parceler:parceler-api:1.0.1'
compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-places:11.0.4'
compile 'com.android.support:support-v4:25.3.1'
compile project(':DogWalkTrackerShared')
testCompile 'junit:junit:4.12'
}
GLOBAL
public class Global extends Application {
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
Manifest (from dog walker Application)
<?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="br.com.cfb.dogwalktracker_dogwalker">
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-feature android:name="android.hardware.location.gps" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<application
android:name="br.com.cfb.dogwalktrackershared.Global"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name_dogwalker"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="label">
<activity
android:name=".LoginActivity"
android:label="#string/app_name_dogwalker">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".GrantPermissionActivity"
android:label="#string/app_name_dogwalker"/>
<activity
android:name=".NavigationDrawer"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" />
<receiver
android:name=".BootReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:name="br.com.cfb.dogwalktrackershared.IncomingSms">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<receiver android:name=".AlarmReceiver" />
</application>
</manifest>
Manifest (From user Application)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.cfb.dogwalkertrackeruser">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:name="br.com.cfb.dogwalktrackershared.Global"
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">
<activity
android:name="br.com.cfb.dogwalktracker_dogwalker.LoginActivity"
android:label="#string/app_name_dogwalker">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="br.com.cfb.dogwalktracker_dogwalker.GrantPermissionActivity"
android:label="#string/app_name_dogwalker"/>
<activity
android:name=".NavigationDrawer"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" />
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
</application>
</manifest>
Manifest from Shared Library
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.cfb.dogwalktrackershared">
<uses-permission android:name="android.permission.INTERNET" />
<application android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true">
</application>
</manifest>
Related
I wanted to use table view in my android application but i get the following error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application#label value=(Curtain Club) from AndroidManifest.xml:13:9-37
is also present at [de.codecrafters.tableview:tableview:2.8.0] AndroidManifest.xml:11:18-50 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:10:5-139:19 to override.
Here is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "Calculator.curtainclub"
minSdkVersion 23
targetSdkVersion 26
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 'com.android.support:recyclerview-v7:26.1.0'
compile 'de.codecrafters.tableview:tableview:2.8.0'
implementation 'com.android.support:wear:26.1.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testCompile 'junit:junit:4.12'
compile project(':jtds-1.3.1')
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestCompile 'com.android.support.test:runner:1.0.2'
androidTestCompile 'com.android.support:support-annotations:27.1.1'
compile files('libs/mail.jar')
compile files('libs/additionnal.jar')
compile files('libs/activation.jar')
}
if i remove the table view library, my gradle syncs perfectly with no errors
Here is my manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="Curtain Club"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".LoginLogout.login">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Employees.AdminLogin" />
<activity android:name=".Calculator.Calc_140_pattern"></activity>
</application>
Please note i have opted out some activity files because there is a lot and it wouldn't allow me to add the question because of too much code
In your manifest file replace this
android:label="Curtain Club"
with
#string/curtain_club
Now Go to your strings.xml file and write this
<string name="curtain_club">Curtain Club</string>
After that rebuild your project
I uploaded my apk it always shows that it is supported by 0 android devices.Please help me to successfully launch my first app. I have uploaded 12 version but is not working anyone. I am basically using location sms and contact read permission in my app.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="deepesh.travel.abhay.applayout" android:versionCode="5" xmlns:tools="http://schemas.android.com/tools">
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
<uses-feature android:name="android.hardware.sensor.compass"
android:required="false" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name="deepesh.travel.abhay.applayout.saved_data_elements"
android:allowBackup="true"
tools:replace="icon, label"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDNVWdbxYpqG08j-wytsWb5cwrBM0mN1ro" />
<activity android:name="deepesh.travel.abhay.applayout.WelcomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="deepesh.travel.abhay.applayout.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
<activity
android:name="deepesh.travel.abhay.applayout.SettingTest"
android:label="#string/title_activity_settings"
android:parentActivityName="deepesh.travel.abhay.applayout.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="deepesh.travel.abhay.applayout.MainActivity" />
</activity>
<activity
android:name="deepesh.travel.abhay.applayout.Tutorial"
android:label="#string/tutorial"
android:parentActivityName="deepesh.travel.abhay.applayout.SettingTest">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="deepesh.travel.abhay.applayout.MainActivity" />
</activity>
<activity
android:name="deepesh.travel.abhay.applayout.privacyPolicy"
android:label="#string/privacy"
android:parentActivityName="deepesh.travel.abhay.applayout.SettingTest">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="deepesh.travel.abhay.applayout.MainActivity" />
</activity>
<receiver android:name="deepesh.travel.abhay.applayout.AlarmReceiver" />
</application>
</manifest>
and My build.gradle file is like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "deepesh.travel.abhay.applayout"
minSdkVersion 14
targetSdkVersion 23
versionCode 12
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "2048M"
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
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:support-v4:25.3.1"
compile 'com.android.support:mediarouter-v7:25.3.1'
compile "com.android.support:support-v13:25.3.1"
compile "com.android.support:appcompat-v7:25.3.1"
compile "com.android.support:cardview-v7:25.3.1"
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.almworks.sqlite4java:sqlite4java-win32-x64:1.0.392'
compile 'com.android.support:preference-v7:25.3.1'
compile 'com.google.android.gms:play-services:10.2.1'
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
compile 'com.google.android.gms:play-services-ads:10.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
testCompile 'junit:junit:4.12'
}
Please help me to successfully launch my first app. I have uploaded 12 version but is not working anyone. I am basically using location sms and contact read permission in my app.
remove <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
no use if u r defining in gradle then if u r targeting to 23 version
then keep ur compileSdkVersion 25 buildToolsVersion "25.0.3" to 26
android:roundIcon="#mipmap/ic_launcher" This is for Android O which is 26
So make your build proper you all mixup with the version
app gradle
compileSdkVersion 26
buildToolsVersion "26.0.1"
minSdkVersion 14
targetSdkVersion 26
versionCode 13
versionName "1.0"
Make build gradle file like this .
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "deepesh.travel.abhay.applayout"
minSdkVersion 14
targetSdkVersion 26
versionCode 17
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "2048M"
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
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:support-v4:26.+"
compile 'com.android.support:mediarouter-v7:26.+'
compile "com.android.support:support-v13:26.+"
compile "com.android.support:appcompat-v7:26.+"
compile "com.android.support:cardview-v7:26.+"
compile 'com.android.support:design:26.+'
compile 'com.android.support.constraint:constraint-layout:1.+'
compile 'com.almworks.sqlite4java:sqlite4java-win32-x64:1.+'
compile 'com.android.support:preference-v7:26.+'
compile 'com.google.android.gms:play-services:10.2.1'
compile 'commons-io:commons-io:2.4'
compile 'com.google.android.gms:play-services-ads:10.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
testCompile 'junit:junit:4.12'
}
And Remove from mainifest file.
I was very confuse, after uploading app to play store.
I saw that my app supports only 13 devises, and all of them are tablet devices.
Could anyone, please, help me?
My AndroidManifest is here:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="24" />
<application
android:name=".activities.base.BaseApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".activities.main.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.homescreen.HomescreenActivity" />
<activity android:name=".activities.camera.CameraActivity" />
<activity
android:name=".activities.settings.SettingsActivity"
android:theme="#style/SWCoinSettingsStyle" />
<activity android:name=".activities.send.SendActivity" />
<activity android:name=".activities.receive.ReceiveActivity" />
<activity
android:name=".activities.login.LoginActivity"
android:windowSoftInputMode="stateAlwaysHidden" />
<meta-data
android:name="name"
android:value="value" />
</application>
Maybe problem is in libraries that I use?
this is part from my build.gradle file:
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "id"
minSdkVersion 14
targetSdkVersion 24
multiDexEnabled true
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(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:24.2.1'
compile 'com.android.support:multidex:1+'
testCompile 'junit:junit:4.12'
compile 'com.scottyab:aescrypt:0.0.1'
compile 'net.danlew:android.joda:2.9.4.1'
compile 'com.github.clans:fab:1.6.4'
compile 'com.android.support:design:24.2.1'
compile('com.mikepenz:materialdrawer:4.3.7#aar') {
transitive = true
}
compile 'com.mikepenz:fontawesome-typeface:4.7.0.0#aar'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.squareup.dagger:dagger:1.2.+'
apt 'com.squareup.dagger:dagger-compiler:1.2.+'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.0.1'
compile 'com.google.code.gson:gson:2.5'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
//QR
compile 'com.google.zxing:core:3.2.1'
compile 'me.dm7.barcodescanner:zxing:1.9'
//log crash
compile('com.crashlytics.sdk.android:crashlytics:2.6.6#aar') {
transitive = true;
}
Also I have some warning during building apk
Some input files use or override a deprecated API. Note: Recompile
with -Xlint:deprecation for details.
Please remove below code from manifest.
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true"/>
Also remove below code
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="24" />
Please help me. I dont know why, when I trying to upload the apk from version code 21 to 22 and version Name from 305 to 306.. playstore showing me detail zero device supported. 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="com.android.studio"
android:installLocation="auto"
android:versionCode="22"
android:versionName="3.0.6">
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="25" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<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_PHONE_STATE" />
<!---->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!---->
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.Manifest.permission.ACCESS_NETWORK_STATE" />
<application
android:name=".SplashScreen"
android:allowBackup="true"
android:hardwareAccelerated="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true">
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<activity
android:name=".SplashScreen"
android:configChanges="keyboardHidden"
android:screenOrientation="portrait"
android:theme="#style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Tutorial"
android:configChanges="keyboardHidden"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan|stateHidden" />
</application>
this is my build.gradle (project)
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
compileOptions.encoding = 'ISO-8859-1'
defaultConfig {
applicationId "com.android.studio"
minSdkVersion 11
targetSdkVersion 25
multiDexEnabled true
renderscriptTargetApi 25
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
packagingOptions {
}
dexOptions {
javaMaxHeapSize "4g"
}
aaptOptions {
cruncherEnabled = false
}
}dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.android.support:support-v4:21.0.3') {
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:percent:25.1.0'
compile 'com.jakewharton:butterknife:8.2.1'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
compile 'com.karumi:dexter:2.3.1'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'// dif
compile 'com.google.firebase:firebase-messaging:9.4.0'// dif
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.github.chrisbanes:PhotoView:1.2.6'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.adeel:easyFTP:1.0'
compile 'com.android.support:exifinterface:25.1.0'
compile 'net.gotev:uploadservice:2.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
compile 'com.google.android.gms:play-services:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
this is my build.gradle (module:app)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
}} allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io"}
}}
It is a bug in google play store you can upload the APK it will be visible for all the devices according to your configuration.
Refer my answer at
APK 0 Device Compatibility
We don't understand why after the upload of our apk on the Google Play Developer Console we have 0 devices supported. Our personal thought is the Manifest and the build.gradle are ok: we can produce apk, than we can distribuite it to our beta tester without problems. Can you help us? Where is our error here, in your opinion?
AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.hendyghsta.bacameter"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="25"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-feature
android:name="android.hardware.camera"
android:required="false"/>
<uses-feature
android:name="android.hardware.camera2.full"
android:required="false"/>
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false"/>
<uses-feature
android:name="android.hardware.location"
android:required="false"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="false"/>
<application
android:name=".common.App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/Theme.AppTheme">
<activity android:name=".activity.LoginActivity">
</activity>
<activity android:name=".activity.TesterActivity">
</activity>
<activity android:name=".activity.SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".activity.ScanActivity"
android:parentActivityName=".activity.MainActivity"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".activity.ResultActivity"
android:label="Input Result"
android:parentActivityName=".activity.MainActivity"
android:theme="#style/Theme.AppTheme">
</activity>
<activity
android:name=".activity.MainActivity"
android:label="Pembaca Meter"
android:theme="#style/Theme.AppTheme">
</activity>
<activity
android:name=".activity.SettingActivity"
android:label="Pengaturan"
android:theme="#style/Theme.AppTheme">
</activity>
<activity
android:name="com.afollestad.materialcamera.CaptureActivity"
android:theme="#style/MaterialCamera.CaptureActivity"/>
<activity
android:name="com.afollestad.materialcamera.CaptureActivity2"
android:theme="#style/MaterialCamera.CaptureActivity"/>
<service
android:name=".common.UploadService"
android:permission="android.permission.BIND_JOB_SERVICE"/>
<activity
android:name=".activity.LogActivity"
android:parentActivityName=".activity.MainActivity"
android:theme="#style/Theme.AppTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.MainActivity"/>
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity
android:name=".activity.MapsActivity"
android:label="#string/title_activity_maps"
android:parentActivityName=".activity.MainActivity"
android:theme="#style/Theme.AppTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.MainActivity"/>
</activity>
<meta-data
android:name="io.fabric.ApiKey"
android:value="***"/>
<service android:name=".account.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:name=".account.FirebaseIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<activity android:name=".activity.PesanActivity" android:theme="#style/Theme.AppTheme">
</activity>
<activity android:name=".activity.BarcodeActivity" android:theme="#style/Theme.AppTheme" >
</activity>
<receiver
android:name=".common.ConnectivityReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
</application>
</manifest>
App Gradle:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'android-apt'
apply plugin: 'realm-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.hendyghsta.bacameter"
minSdkVersion 21
targetSdkVersion 25
versionCode 6
versionName "3.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
config {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('C:/Users/Acer/.android/debug.keystore')
storePassword 'android'
}
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
packagingOptions {
//exclude 'META-INF/DEPENDENCIES'
//exclude 'META-INF/LICENSE'
// exclude 'AndroidManifest.xml'
exclude 'lib/arm64-v8a/librealm-jni.so'
exclude 'lib/mips/librealm-jni.so'
exclude 'lib/x86/librealm-jni.so'
exclude 'lib/x86_64/librealm-jni.so'
exclude 'lib/x86/libopencv_java3.so'
exclude 'lib/x86/libanylineCore.so'
exclude 'lib/x86/libgnustl_shared.so'
}
}
repositories {
flatDir {
dirs 'libs'
}
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://dl.bintray.com/drummer-aidan/maven" }
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
}
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(name: 'anylinesdk-3.8.1', ext: 'aar')
compile project(':mcamera')
compile('com.crashlytics.sdk.android:crashlytics:2.6.7#aar') {
transitive = true;
}
compile('com.pubnub:pubnub-android:3.7.14#aar') {
transitive = true;
}
compile('io.fabric.sdk.android:fabric:1.3.10#aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:support-v13:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
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.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
compile 'io.reactivex:rxjava:1.1.3'
compile 'com.artemzin.rxjava:proguard-rules:1.1.3.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'org.glassfish:javax.annotation:10.0-b28'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup:otto:1.3.8'
compile 'net.gotev:uploadservice-ftp:3.2.3'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.afollestad.material-dialogs:core:0.9.1.0'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'jp.wasabeef:recyclerview-animators:2.2.5'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
compile 'com.github.rey5137:material:1.2.4'
compile 'com.robinhood.ticker:ticker:1.1.1'
compile 'com.orhanobut:dialogplus:1.11#aar'
compile 'com.google.android.gms:play-services-vision:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.google.maps.android:android-maps-utils:0.4.4'
compile 'me.dm7.barcodescanner:zbar:1.8.4'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'io.realm:android-adapters:1.4.0'
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
You have a problem with location:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
Acctording to documentation:
Caution: If your app targets Android 5.0 (API level 21) or higher, you must declare that your app uses the android.hardware.location.network or android.hardware.location.gps hardware feature in the manifest file, depending on whether your app receives location updates from NETWORK_PROVIDER or from GPS_PROVIDER. If your app receives location information from either of these location provider sources, you need to declare that the app uses these hardware features in your app manifest. On devices running verions prior to Android 5.0 (API 21), requesting the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permission includes an implied request for location hardware features. However, requesting those permissions does not automatically request location hardware features on Android 5.0 (API level 21) and higher.
So add
<uses-feature android:name="android.hardware.location.gps" />
<uses-feature android:name="android.hardware.location.network" />
You can remove uses-sdk tag from Manifest too. Try to upload another version.
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="25"/>
There can be problem with Google Developer console too. They are updating the system. You may try new App App release, try to create a ALPHA release.