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
Related
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
So I am currently trying to store user details into a database, however the program does not mention any errors upon execution, but the application keeps on crashing when trying to open it. This is my error code in logcat:
Code gist will be provided upon request
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.finalyearprojectapp"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-firestore:22.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
try adding multidex support
defaultConfig {
// Your previous stuffs
multiDexEnabled true
}
for more info you can visit this thread. This can be helpful too: https://stackoverflow.com/a/39831657/7237222
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.
I'm struggling to make my app work after i added Facebook login with Firebase.
I've been having different issues however all of them are about versions and change something in manifest data. The last issue that i got was:
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#com.facebook.sdk.ApplicationId#value
value=(#string/facebook_app_id) from AndroidManifest.xml:23:13-52 is
also present at [com.firebaseui:firebase-ui-auth:2.3.0]
AndroidManifest.xml:24:13-60 value=(#string/facebook_application_id).
Suggestion: add 'tools:replace="android:value"' to
element at AndroidManifest.xml:22:9-23:54 to override.
I have already tried to change and add the metada tag however it has not worked.
My Gradle file is like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "br.sosqueen.com.sosqueen"
minSdkVersion 23
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'
}
}
}
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'
})
//General
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.support:design:25.0.0'
// Firebase UI Database
compile 'com.firebaseui:firebase-ui-database:3.1.0'
//Google Play Services
compile 'com.google.android.gms:play-services-auth:11.2.0'
//Firebase
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
//Facebook Login
compile 'com.facebook.android:facebook-login:[4,5)'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
I know that i am using lots of dependencies however i do need them all.
Can anybody help me, please?????
This is better than
buildToolsVersion "26.0.2"
buildToolsVersion '27.0.3'
//Firebase
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-database:3.2.2'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
Visit this page to check the correct Facebook configuration, such as retail keys and so on:
https://developers.facebook.com/docs/facebook-login/android
I am creating an android app currently using firebase and facebook. I am trying to add a facebook login button, but when I add the line compile 'com.facebook.android:facebook-android-sdk:[4,5)' I get the error
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.0.0-alpha1) from [com.android.support:design:26.0.0-alpha1] AndroidManifest.xml:27:9-38
is also present at [com.android.support:cardview-v7:25.3.1] AndroidManifest.xml:24:9-31 value=(25.3.1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:25:5-27:41 to override.
when I try to sync the gradle build. Here is what my app build.gradle file looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26"
defaultConfig {
applicationId "com.notnow.barapp"
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:design:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
It's because Facebook library use com.android.support:cardview-v7:25.3.1 and you cannot use different support library with different version number. I resolved downgrading compileSdkVersion to 25 and all the support library to 25.3.1. You can check that Facebook library is using com.android.support:cardview-v7:25.3.1 at the following link: Facebook Core Gradle
Hope it helps.