Flutter Plugin Development - Unable to use ContextCompat in my Project - android

I am trying to develop a flutter plugin for android permissions. It through this error
I already search other different question here but none is solving my problem
have a look at this screenshot too
Image 2
this means I am unable to access .support class
I already tried to add
implementation 'com.android.support:appcompat-v7:28.0.0'
or
implementation 'com.android.support:appcompat-v4:28.0.0'
My Gradle file looks like this
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
}
after upgrading my plugin to Android X it through these errors
Error After Upgrading to Android X

Try migrating to AndroidX (if not already there) and change the support dependency to:
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.core:core:1.0.2'

Related

error: package android.support.v7.app does not exist after migrating to android x

I have migrated to android x, Included google()repo to build.gradle(project's) and implementation 'com.android.support:appcompat-v7:22.0.0' to app's build.gradle, After migrating to android x can not install support libraries through sdk manager. how can i solve this? I have visited similar questions and no suitable answer for my case.
Try to use AndroidX version of appcompat
implementation 'androidx.appcompat:appcompat:1.1.0'
Instead of
implementation 'com.android.support:appcompat-v7:22.0.0'

Problem with rendering, how can I solve it?

I have a problem with the preview of my app.
In the log file i have a few errors :
This is a group project but I am the only one encountering this problem. I just downloaded Android Studio so I did not touch anything in the settings.
Any idea?
Add constraint layout dependency in build.gradle
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Just click the blue text that prompt in your console
or try to add these into your gradle (app level)
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
And you can update them to latest version if Android Studio tells you there's a new version.

Android gradle sync : Could not get resource firebase-measurement-connector-impl-17.0.4-javadoc.jar

I'm using Android Studio last version 3.2.1
I've created a sample project for testing the problem I have on my main app. I thought at first it was a thing of my app, but I get the same problem on the very simple test app.
So here app the important dependencies of the test app :
classpath 'com.android.tools.build:gradle:3.2.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
Gradle sync works fine.
But as soon as I add these 2 lines in dependencies
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
Gradle sync generate 2 warnings about 2 missing javadocs :
org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-measurement-connector-impl/17.0.4/firebase-measurement-connector-impl-17.0.4-javadoc.jar
org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-core/16.0.6/firebase-core-16.0.6-javadoc.jar'
It's a warning, OK, but on my main app which have almost 100 flavors, gradle generate 200 failing http requests which delays the gradle sync significantly.
Is there a way I coud ask gradle to stop requesting these files ?
After a couple of tests, it seems that the problem is with
implementation 'com.google.firebase:firebase-core:16.0.6'
I replaced it with
implementation 'com.google.firebase:firebase-core:16.0.5'
And I don't get the warnings anymore. It seems that somebody forgot to provide all the javadocs for last version 16.0.6 of firebase-core. I can live with not using the last version, so I'll use 16.0.5 to avoid this warning.

Build library Github with Jitpack include dependencies

I'm building a library with jitpack.io I was able to build and compile into the application successfully, but the problem here is that in the library there includes a number of other libraries compiled into
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.facebook.android:audience-network-sdk:4.99.1'
implementation 'com.appnext.sdk:banners:2.4.2.472'
implementation 'com.appnext.sdk:ads:2.4.2.472'
implementation 'com.appnext.sdk:native-ads2:2.4.2.472'
implementation 'org.jsoup:jsoup:1.11.3'
so when I compiled the library into my application and called it, it reportedly did not find the class I was including into libraries(org.jsoup., com.appnext., ..). If I want to use I have to re-declare the libraries on again in my application. Is there a way to not do this, as includes the library inside
I was facing the same issue and apparently it's a bug in maven gradle plugin v1.5; problem solved after my plugin version is updated to 2.1.
Issue: https://github.com/dcendents/android-maven-gradle-plugin/issues/61
Related Answer: https://stackoverflow.com/a/51190164/1640033

Fix the version conflict either by updating the version of the google-services plugin or updating the version of com.google.android.gms to 11.8.0 [duplicate]

This question already has an answer here:
How to add firebase-admin to my android project?
(1 answer)
Closed 5 years ago.
I'm developing an Android app using Firebase, and went to install the Admin SDK using this tutorial. In my build.gradle file in my app, I've had a couple of dependencies that have given me warnings since I added them earlier in the project, but I was still able to run the application. Once I added the dependency needed for Admin SDK, things got a little more serious...
These are the original dependencies and their warnings:
implementation 'com.google.firebase:firebase-core:11.8.0'
All gms/firebase libraries must be the exact same version specification. Found versions 9.6.0, 11.8.0
implementation 'com.android.support:appcompat-v7:26.1.0'
All com.android.support libraries must be the exact same version specification. Found versions 26.1.0, 23.4.0
I searched the whole project using the double-shift search function in Android Studio and couldn't find anything that used either of the conflicting versions mentioned (9.6.0 or 23.4.0).
Like I said, the app still ran so I carried on developing. While adding the Firebase Admin SDK, I added the following dependency to my build.gradle:
implementation 'com.google.firebase:firebase-admin:5.6.0'
When I hit 'sync' on my gradle, I got the following error:
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.8.0.
This has left me a bit confused as I believe the most recent version of com.google.firebase:firebase-admin to be 5.6.0, so I don't see how I can be getting a version conflict for using this.
My app won't run while this error exists, so any help getting past it would be very much appreciated. I'm new to Android development so it might well be something very obvious that I've missed.
Here is my full list of dependencies:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0' <-- warning
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.8.0' <-- warning
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.firebaseui:firebase-ui:0.6.0'
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-admin:5.6.0' <-- introduced error
implementation 'com.google.firebase:firebase-messaging:11.8.0'
}
If I can include anything else that will help with diagnosing, please let me know!
Thanks in advance,
Mark
The Firebase admin SDK is meant for JVM servers and can't be used in tandem with client SDKs. See this great post for more details. I would recommend using Cloud Functions for admin stuff instead since they're something you control and can't be compromised on the client.

Categories

Resources