I have created an android application. I have generated a signed apk and my app is working very well on all devices except OPPO A37.
I don't know what is the main issue. I have also tried to debug the app with the developer option. But the device is not showing on my android studio
Build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 33
defaultConfig {
applicationId "com.example.wrfent.wrfnanbookings"
minSdkVersion 19
targetSdkVersion 33
versionCode 3
versionName "3.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
//noinspection GradleCompatible
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.facebook.network.connectionclass:connectionclass:1.0.1'
implementation 'fr.bmartel:jspeedtest:1.32.1'
testImplementation 'junit:junit:4.13.2'
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.10'
}
Hello you can use the feedback feature library
understand and fix bugs when your apps have a crash
see this
Related
I am using Android Studio 4.0.1. The following error occurs when I try to produce a debug version of the program. (No problem to produce a release version!)
Create Debug Version
ERROR
Entry name 'javax/annotation/CheckReturnValue.java' collided
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
//apply plugin: 'com.google.firebase.firebase-perf'
android {
compileSdkVersion 28
defaultConfig {
applicationId "ai"
minSdkVersion 19
targetSdkVersion 28
versionCode 6
versionName "0.3.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix '.dev'
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.kailashdabhi:om-recorder:1.1.5'
implementation 'com.fxn769:musicwave:1.0'
implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:4.1.2'
// implementation "androidx.viewpager2:viewpager2:1.0.0"
//firebase
implementation 'com.google.firebase:firebase-analytics:17.5.0'
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-messaging:20.2.4'
// implementation 'com.google.firebase:firebase-perf:19.0.5'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.github.GrenderG:Toasty:1.4.1'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.2.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
implementation 'com.github.amirdew:JSON:v1.0.0'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.github.ohoussein.playpauseview:playpauseview:1.0.2'
implementation 'com.nabinbhandari.android:permissions:3.7'
implementation 'com.job:droidnet:2.0.0'
implementation 'com.daimajia.easing:library:2.0#aar'
implementation 'com.daimajia.androidanimations:library:2.3#aar'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.0'
}
I cleaned the project and even rebuild it but the problem remains.
Deleting the existing apk from the debug folder and rebuilding the apk should work.
apply plugin: 'com.android.application'
android
{
compileSdkVersion 24
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.asus.salestrackingsystem"
minSdkVersion 15
targetSdkVersion 24
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:design:25.3.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.firebase:firebase-auth:16.0.5'
compile 'com.google.firebase:firebase-database:16.0.5'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
but still cant success to add realtime database , firebase assistant keep asking to add the realtime database to your app . anyone can help me?
Follow the below links.
https://blog.mindorks.com/firebase-realtime-database-android-tutorial
https://github.com/MChehab94/Firebase-Realtime-Database-Demo
https://www.simplifiedcoding.net/firebase-realtime-database-crud/
https://www.vogella.com/tutorials/Firebase/article.html
https://www.androidtutorialpoint.com/firebase/firebase-database-tutorial/
https://proandroiddev.com/firebase-android-playground-realtime-database-560d4e18404a
add these dependencies to integrate firebase realtime database:
implementation 'com.google.firebase:firebase-auth:16.1.0' // this is for user registration
implementation 'com.google.firebase:firebase-database:16.0.5' // this for database
implementation 'com.google.firebase:firebase-core:16.0.5' // this is for core functionality
implementation 'com.google.firebase:firebase-messaging:17.3.4' // this is for notifications
implementation 'com.google.firebase:firebase-storage:16.0.5' // this is for storage
implementation 'com.google.android.gms:play-services-auth:16.0.1' // this is for user authentication
classpath 'com.google.gms:google-services:4.2.0' // this will be added in project level gradle file
I'm adding Firebase Storage to upload images for my app, however after adding the dependency; I get the following errors:
My build.gradle(app) looks like this.
It is sadly not possible for me to use a higher SDK version as its a school project and we are limited to SDK 19...
Tried some multidex but couldn't make it work...
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.project.socker"
minSdkVersion 19
targetSdkVersion 29
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 = 1.8
targetCompatibility = 1.8
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-ui:2.1.0'
def nav_version = "2.1.0"
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
....\Socker\app\src\main\java\com\project\socker\MainActivity.java:
uses or overrides a deprecated API.
Recompile with -Xlint:deprecation for details.
OR
Cannot fit requested classes in a single dex file (# methods: 65924 > 65536)
Used a lower version like
implementation'com.google.firebase:firebase-storage:16.0.4'
I'm using Android Studio. I have two modules: the app (UI) and a library. When tested separately, both compile and work as they should, but when I try to use some of the library classes on the app, I can't build the project. I get this error:
Error: Program type already present: org.apache.xmlbeans.xml.stream.Location
My library build.gradle has just a few lines:
apply plugin: 'java-library'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'org.apache.poi:poi:3.17'
implementation 'org.apache.poi:poi-ooxml:3.17'
}
sourceCompatibility = "7"
targetCompatibility = "7"
Then my app's build.gradle is this
android {
compileSdkVersion 28
defaultConfig {
applicationId "skrb.appprueba"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:28.0.0'
implementation project(path: ':coreLib')
}
When adding this (implementation project(path: ':coreLib'), I get the error and I don't know how to solve it.
Things that I tried:
Cleaning and rebuilding the project.
Setting multiDexEnabled to true
according to the error message, it should rather be:
implementation (project(path: ":coreLib")) {
exclude group: "org.apache.xmlbeans"
}
Try this one:
implementation(project(path: ':coreLib')) {
exclude module: 'poi'
exclude module: 'poi-ooxml'
}
Here you could find more information why this error happen.
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.example.speakplease"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation ('com.google.apis:google-api-services-translate:v2-rev47-
1.22.0')
implementation 'com.google.cloud:google-cloud-translate:0.5.0'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.android.support:support-v13:28.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
compileOnly 'com.google.dagger:dagger-parent:2.9'
//noinspection GradleDependency
annotationProcessor 'com.google.auto.value:auto-value:1.2'
}
apply plugin: 'com.google.gms.google-services'
I have imported google translation api and after that I started getting Annotation error. I am able resolve it but not getting this error. I am aware of it that some dependencies are clashing but unable to find out.
Here is the error.
Program type already present:
com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream
Message{kind=ERROR, text=Program type already present:
com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream,
sources=[Unknown source file], tool name=Optional.of(D8)}
This is what happens when your 2 dependencies include the same dependency. Check out this question to find out how to see which dependency is causing the issue.
I have had the same problem, for me it was ExoPlayer, cause It was included in a 3rd party library I was using, and I included it by itself also.
I don't know for sure which 2 are in conflict for you, but these seem suspiciously "related":
implementation ('com.google.apis:google-api-services-translate:v2-rev47-1.22.0')
implementation 'com.google.cloud:google-cloud-translate:0.5.0'