Android app supports zero devices? - android

I've read all the SO questions that are related to this question, but none have helped me solve this problem. I uploaded an early alpha, which supported about 8000+ devices, but the current version supports zero, according to Google Play.
I have only two uses-permission statements, and no uses-feature statements. I've tried removing the uses-permission statements, but (although I get another, different warning about the billing one being absent) I still allegedly support zero devices, even without those.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hearttech.intimacytoolbox" >
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name=".Application"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_shortname"
android:theme="#style/Theme.NoTitle" >
<activity
android:name=".MainActivity"
android:label="#string/app_shortname"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
[SNIPPED a bunch of other activities from here for length]
</application>
</manifest>
build.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'IntimacyToolboxKey'
keyPassword 'fakepassword'
storeFile file('/Users/dave/Dropbox/Intimacy Toolbox/android/Ancillaries/android.jks')
storePassword 'fakepassword'
}
}
compileSdkVersion 23
buildToolsVersion "23"
defaultConfig {
applicationId "com.hearttech.intimacytoolbox"
minSdkVersion 15
targetSdkVersion 23
versionCode 3
versionName '0.2'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
debuggable true
}
}
sourceSets {
main { assets.srcDirs = ['src/main/assets'] }
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('org.simpleframework:simple-xml:2.7.1') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
}
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.guava:guava-collections:r03'
compile 'com.google.guava:guava-io:r03'
compile 'com.google.guava:guava-base:r03'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:support-annotations:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'org.apache.directory.studio:org.apache.commons.codec:1.8'
compile 'com.anjlab.android.iab.v3:library:1.0.27'
}
I've seen in places that duplicate libraries can cause this problem, but I haven't added anything outside of the dependency system that uses jcenter. In the gradle log output, it lists only these libraries as having been prepared:
:app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72300Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42300Library UP-TO-DATE
:app:prepareUkCoChrisjenxCalligraphy210Library UP-TO-DATE
I would appreciate any insight as to why Google Play thinks I don't support any devices. Thanks in advance!

So, the problem turned out to be the Apache Commons codec library. I had imported the library using jcentral, the default repository for Android Studio. That worked fine for the other libraries I needed, but for Apache Commons, when uploading the APK that way, Google Play APK uploader lists commons-codec-1.8.jar as a "Native Platform" for the app, which apparently makes the app incompatible with all devices.
To fix the problem, I instead downloaded the .jar file from the Apache Commons website and added it to my [project root]/app/libs directory, and removed the dependency line from gradle.build. This fixed the problem!

Although gradle should do this for you, try adding this in your app manifest.
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="23" />

Related

Android Cause: duplicate entry: AndroidManifest.xml

My question is already asked by someone. But could not find the solution in that.Same error and same project like in these two links
enter link description here
enter link description here
None of above links questions not answered properly.For me, It was working first. I migrated to androidx then got this error. Can someone help me to solve issue and how duplicated file created ?
Manifest 1 :
Already added in those two links.
Manifest 2 : Another module Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rahuljanagouda.statusstories">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:label=
"#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
>
<meta-data
android:name="com.rahuljanagouda.statusstories.glideProgressBar.OkHttpProgressGlideModule"
android:value="GlideModule" />
<activity android:exported="true"
android:name="com.rahuljanagouda.statusstories.StatusStoriesActivity" />
</application>
</manifest>
Build.gradle :
apply plugin: 'com.android.library'
//apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.rahuljanagouda'
version = '1.0.0'
android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
defaultConfig {
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
// Glide v3 (stable)
implementation 'com.github.bumptech.glide:glide:3.9.0-SNAPSHOT'
// OkHttp3
implementation 'com.github.bumptech.glide:okhttp3-integration:1.6.0-SNAPSHOT'
implementation 'com.squareup.okhttp3:okhttp:3.14.4'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
Try to update all the libraries to latest version and also check your lib folder for the project. Delete the files from that folder if exist any .

Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. > java.lang.UnsupportedOperationException (no error message)

I am not sure why this is happening, but I did some digging and tried to find other solutions. None worked out especially duplicate questions:
android {
compileSdkVersion 26
buildToolsVersion "23.0.3"
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.android.support', module: 'support-annotations'
}
defaultConfig {
applicationId "com.myapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':react-native-customized-image-picker')
compile project(':react-native-vector-icons')
compile project(':react-native-restart')
compile project(':react-native-image-picker')
compile project(':react-native-fast-image')
compile project(':lottie-react-native')
compile project(':react-native-fetch-blob')
compile "com.android.support:multidex:1.0.1"
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.fresco:fresco:1.0.1"
compile "com.facebook.fresco:animated-gif:1.0.1"
compile("com.facebook.react:react-native:0.54.0") { force = true } // From node_modules
}
I deleted some duplicate compiles that I found and still no help. I noticed in the trace this warning:
C:\ReactProjects\myapp\android\app\src\main\AndroidManifest.xml:11:5-29:19 Warning:
application#android:theme was tagged at AndroidManifest.xml:11 to replace other declarations but no other declaration present
C:\ReactProjects\myapp\android\app\src\main\AndroidManifest.xml:16:9-19:35 Warning:
meta-data#com.bumptech.glide.integration.okhttp.OkHttpGlideModule was tagged at AndroidManifest.xml:16 to remove other declarations but no other declaration present
I don't know if that will cause this whole thing to fail. Lastly here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<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" />
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:allowBackup="true"
tools:replace="android:theme"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
Every problem that I had when trying to get a successful build I looked on SO or other sources, but this one takes the cake. I never inserted compile "com.android.support:multidex:1.0.1" before and it worked before this problem occurred. Still no success.
The last thing I remembered doing is saving a file called 'safecode.js' in the home directory and basically it just has code that I want to save.
I had the exact same problem and I understand what a headache this can be. Here was my solution:
1) Make sure there are no duplicate dependencies in build.gradle and settings.gradle
2) Most of you might not like this one, but I (hurts to type this) upgraded most things such as:
compileSdkVersion 26 - build.gradle
buildToolsVersion "26.0.1" - build.gradle
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip - settings.gradle
classpath 'com.android.tools.build:gradle:3.1.0' - build.gradle not in app directory
NOTE: Your Command Prompt's build UI will change and it does look overwhelming, but pretty cool. You'll get used to it. Also, you might need to change those compile in build.gradle soon.
Here is the solution for that: Android Studio build.gradle warning message
That should be pretty much it, but I'll also tell you other things I did that might affect your BUILD FAILED:
1) You might need Java 8. JDK 1.8. Add this to build.gradle app directory:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2) Get rid of compile "com.android.support:multidex:1.0.1"
3) targetSdkVersion 22 update to 26
And lastly,
4) In build.gradle not in app directory, put maven { url 'https://maven.google.com' } in both repos.
NOTE: You could use google() in place of that, but it didn't work for me so I stuck with maven { url 'https://maven.google.com' }.
ALSO TO NOTE: You might get messages saying, "WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.". Hey, 26 seems to be our magic number, if it works, then don't touch it. Unless you are absolutely certain you need to.
To my knowledge and experience the warnings you get from the build process won't affect your BUILD SUCCESS or BUILD FAILED.
I hope this works for everyone!

Android application on Gradle: Unable to merge dex

I have an error with my app in Android studio:
Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
I use Gradle and Kotlin.
Android Studio 3.0.1.
Windows 10 Pro 64.
I have research this theme on SO and I have tried some solution from here, like that:
Clean and rebuild project. No changes.
Change 'compile' in gradle to 'implementation'. No changes.
Delete .gradle and build directories. No changes.
Add multiDexEnabled true in defaultConfig in gradle. In this case, I have another error:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> java.io.IOException: Can't write [G:\work\myapp\app\build\intermediates\multi-dex\debug\componentClasses.jar]
(Can't read [C:\Users\Public\.gradle\caches\transforms-1\files-1.1\support-core-utils-27.0.2.aar\e1c9881d763269b67bf59dc03d19c305\jars\classes.jar(;;;;;;**.class)]
(Duplicate zip entry [classes.jar:android/support/v4/content/PermissionChecker$PermissionResult.class]))
My build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
defaultConfig {
multiDexEnabled true
applicationId "myapp"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
applicationIdSuffix ".dev"
}
staging {
debuggable true
applicationIdSuffix ".sta"
}
preproduction {
applicationIdSuffix ".pre"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.basecamp:turbolinks:1.0.7'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// The Client SDK resides on jCenter
implementation 'com.twilio:client-android:1.2.21'
}
My AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tunnll.passenger">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<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">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.twilio.client.TwilioClientService"
android:exported="false" android:stopWithTask="true"/>
</application>
What am I missing?
UPD
It seems I found out the point after that the problem has appeared. It was after adding Twilio configuration. I used this manual: Twilio and Android
This is all changes that have been done:
Add to build.gradle:
implementation 'com.twilio:client-android:1.2.21'
Add to AndroidManifest:
<service android:name="com.twilio.client.TwilioClientService"
android:exported="false" android:stopWithTask="true"/>
Add to proguard-rules.pro
# Twilio Client
-keep class com.twilio.** { *; }
# Apache HttpClient
-dontwarn org.apache.http.**
That's all. Before this changes I didn't have this error
Use this in your build.gradle in app Module if you want to read an .aar file
for your libs dir:
repositories{
flatDir{
dirs 'libs'
}
}
dependencies {
compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar')
}
But it seems that your problem is multidex(means that you have more than 65K methods in your project so use this:
android {
defaultConfig {
multiDexEnabled true
}
}
and if your minSdk < 20 then use this as well:
compile 'com.android.support:multidex:1.0.1'
Hope it helps!!!

Android Studio Error: Execution failed for task ':app:processDebugManifest'

I am completely new to Android Studio so it may sound a silly thing to an experienced person.
I am getting an error in Android Studio which states:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION#value
value=(25.3.1) from [com.android.support:design:25.3.1]
AndroidManifest.xml:27:9-31
is also present at [com.android.support:appcompat-v7:26.0.0-alpha1]
AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at
AndroidManifest.xml:25:5-27:34 to override.
I have Googled this and tried looking into it to solve it on my own, however, similar issues that I have found aren't quite the same errors.
I'm not experienced enough to understand and generate a fix for it although I understand some of it.
It may be the case that I need to provide more information for this so please let me know if so.
EDIT:
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.g732d.appname"
>
<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">
<activity
android:name=".HomeActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Patients" />
<activity android:name=".NewPatient" />
<activity android:name=".StartActivity"></activity>
</application>
</manifest>
build.gradle (Project: appname):
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they
belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (Module: App):
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.g732d.appname"
minSdkVersion 19
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 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:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
}
SECOND EDIT:
Following the answer by Arefeh and the comment by Kunal, I changed the version mismatch by replacing compile 'com.android.support:design:25.3.1' with compile 'com.android.support:design:26.0.0-beta2'.
For this to work, I had to add maven { url "https://maven.google.com" } in the build.gradle (Project: appname) file within allprojects{} (have updated above to illustrate this).
Now I keep getting a render error which says failed to instantiate one or more classes. The classes are different for each activity depending on what I've used in the activity e.g.
The following classes could not be instantiated:
- android.support.v7.widget.AppCompatImageView
...
...
I guess the problem is for difference between versions of support libraries. Change your version of design library to 26 or higher.
compile 'com.android.support:design:26.+'
What seems to have worked in this instance, is going to File > Project Structure then in app > Properties where it says Compile Sdk Version and Build Tools Version, I changed them to API 25: Android 7.1.1 (Nougat) and 25.0.3 respectively. After which I synced the project and gradle and then rebuilt.
I then repeated the process and changed back again to API 26: Android 8.0 (O) and 26.0.0. So far it is working again although I will update if this changes.

Many errors after trying to set facebook-sdk in android studio

I have 2 issues. First, I added the facebook sdk, and after that, many errors appeared.
The same but repetitive errors in my java 'main file' is 'cannot resolve symbol' in the R and all others.
second issue, the following error:
"diamond operator is not supported in -source 1.6" , "Execution failed for task ':facebook:compileReleaseJava'. > compilation failed; see the compiler error output for details."
(and that's after doing everything just like in the tutorials)
thanks in advance! I'm stuck in this like for about 3 weeks and almost everyday I tried solving but I still can't figure out a way.
grade:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '19.1.0'
defaultConfig {
applicationId "com.example.noy.myapplication"
minSdkVersion 13
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.android.support:appcompat-v7:22.1.1'
compile project(':facebook')
}
manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.noy.myapplication" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
thanks
You can simplify the use of the library by calling
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
in your build.gradle file
1)Include in your apps settings.gradle
like this:
include ':facebookSDKVersion_3141'
2)You have to compile your facebook sdk in your apps build.gradle
do like this:
dependencies {
compile project(':facebookSDKVersion_3141')
}
Clean the project and build the project again should work.
or
There is an easier way ,click on file on android studio
select New Module->Import Existing Project->Browse the location of your sdk
and this should work

Categories

Resources