Program type already present: com.google.android.youtube.player.YouTubeApiServiceUtil after migrating to AndroidX - androidx

After migrating my project to AndroidX (https://developer.android.com/jetpack/androidx/migrate) I get the following error:
Error: Program type already present: com.google.android.youtube.player.YouTubeApiServiceUtil

The following worked for me:
Migrate your project to AndroidX by selecting Refactor >
"Migrate to AndroidX" from the menu bar.
Select Build > Clean project
Restore Android Studio
Now, I'm using YouTubePlayerSupportFragment and AndroidX in my project (Match4App) and I was able to publish it without any issues.
Comment: This task also allowed me to upgrade all other libraries that depend on AndroidX (i.e. com.firebaseui:firebase-ui-auth:6.0.2, com.google.android.gms:play-services-games:18.0.1, com.google.android.gms:play-services-auth:17.0.0, com.google.android.gms:play-services-ads:18.2.0, etc.).

Related

How to know which version of Google Firebase plugin to use in Flutter app?

I've been stuck with Gradle not building (working on iOS fine). I struggled because Gradle was giving a generic error, finally got this today:
FAILURE: Build failed with an exception.
* What went wrong: Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0. 0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.firebase:firebase-messaging:18.0.0 -> com.google.firebase:firebase-iid#[18.0.0], but fire base-iid version was 17.1.2.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends on project 'firebase_messaging' which depends onto com.google.firebase:firebase-messaging#18.0. 0
-- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:firebase-core#16.0.9 -- Project 'app' depends on project 'firebase_analytics' which depends onto com.google.firebase:firebase-analytics#16.5. 0 -- Project 'app' depends on project 'firebase_remote_config' which depends onto com.google.firebase:firebase-config#16.4 .1 -- Project 'app' depends onto com.google.firebase:firebase-core#16.0.9
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file.
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
This was after I took out the version numbers from my pubspec to see if that would help. I don't understand Google's version numbering and I'm not sure which versions of plugins I should be installing as it has caused conflicts in the past:
dependencies:
flutter:
sdk: flutter
http:
cached_network_image:
flutter_cache_manager:
carousel_pro:
cloud_firestore:
firebase_core:
firebase_remote_config:
dynamic_theme:
flutter_signin_button:
shared_preferences:
share:
flutter_search_bar:
google_sign_in:
#flutter_facebook_login:
flutter_html:
requests:
webview_flutter:
flutter_webview_plugin:
firebase_analytics:
flutter_app_badger: #for launcher badge icon (notifications)
uuid:
font_awesome_flutter:
device_info:
carousel_slider:
flutter_spinkit:
flutter_typeahead:
firebase_messaging:
html_unescape:
flutter_masked_text:
configurable_expansion_tile:
stripe_payment:
square_in_app_payments:
Google doesn't seem to maintain consistent version numbering and by taking out the version numbers I thought it would at least take the latest version of the plugins which theoretically should work. So, how can I solve this?
You should begin by putting the version number back in there.
This is an issue with firebase / play services versions being mismatched so you know for sure the other plugins in your pubspec.yaml are fine.
The dependancy which is failing is firebase messaging.
It's using many words to tell you
com.google.firebase:firebase-messaging:18.0.0 package depends on com.google.firebase:firebase-iid#[18.0.0]
but it's only finding 17.1.2.
You need
com.google.firebase:firebase-core#16.0.9
com.google.firebase:firebase-analytics#16.5.0
com.google.firebase:firebase-config#16.4.1
in the future, if you are having version issues check the specific packages GitHub issues to see if there's anything currently wrong with the version you're on. This will save you a lot of time.
I wouldn't recommend removing version numbers from your pubsepc.yaml but if you type
firebase_messaging: any
It will get a compatible version for you.
The error you are getting is not necessarily from the packages you have listed in pubspec.yaml. It is referring to the dependencies on build.gradle.
Google has no issue with the version numbers. There is a difference between the versions of packages i.e what you have listed on pubspec.yaml and the dependencies on app/build.gradle. It would be wise to reconsider the number of packages you use as every package has a dependency and you may end up in a sticky situation where multiple packages are conflicting. In addition you end up with a bloated solution for minimal functionality.
Removing version numbers will not help as some packages are incompatible. I would suggest you start with the packages you require i.e the firebase which from experience have no issues then incrementally add if necessary.

Unable to update database to match the current model. Failing only on self hosting project

The following code:
Database.SetInitializer
(new MigrateDatabaseToLatestVersion<Db, Migrations.Configuration>(true));
using (var C = new Db())
{
Console.WriteLine(C.Usuarios.Count());
}
Works on a console test project but on the other console with self-hosting it fails with the Unable to update database to match the current model... migration error
Obviously the migrations are up to date since the other project runs fine and they both do the same configuration since the database model and the migration configuration are on a separated library
I tracked down the problem to the Newtonsoft.Json library.
The package Microsoft.AspNet.WebApi.Client depends on the version 6.0.4 of this library which seems to have conflicts with Entity Framework.
Just upgrading the Newtonsoft.Json with Install-Package Newtonsoft.Json solves the problem

ASP.NET 5 Keeps crashing VS on project initialization

I have a solution with several MVC6 (asp.net 5) projects.
Each project uses bower and npm for packages. Bower has normalize-css and jquery installed.
9 out of 10 times I start the solution, it will crash during one of the mvc project's initialization-phase. If I debug I get the following error.
An unhandled exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in mscorlib.dll
Additional information: Unexpected end when deserializing object. Path 'dependencies.jquery.pkgMeta.devDependencies', line 43, position 1.
If I remove jquery from bower dependencies and have only normalize-css left I get:
An unhandled exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in mscorlib.dll
Additional information: Unexpected end when deserializing object. Path 'dependencies.normalize-css.pkgMeta._release', line 39, position 1.
I have uninstalled all bower packages and the problem is fixed, but I obviously still need the packages, so when adding jquery or another package again the crashing starts again.
I am using Visual Studio 2015 Enterprise.
edit for bower.json:
{
"name": "ASP.NET",
"private": true,
"dependencies": {
"jquery": "2.1.4",
"normalize-css": "3.0.3"
}
}
Try clean up nuget, npm and bower cache - it's help in my case:
Delete files in your user folder:
..\.dnx\packages\* should be restored automatically, but please make backup first,
..\.nuget\packages\* like above, please make backup first,
..\AppData\Local\bower\cache\*
..\AppData\Roaming\npm-cache\*
..\AppData\Local\Temp\*
Of course close VS before doing this, and VS restore all packages on first running.
Also you can clean up .vs folder in your project folder - theoretically it's not related, but from my experience - it's helping with numbers VS issues.
It seems like fixing another bug, see my answer here: https://stackoverflow.com/a/37331585/2713516 worked wonders for the crashing.
It hasn't crashed since if I recall correctly. Either way, the combination of updating all dll's (especially newtonsoft.json, including removing old versions from disk) and going through the steps suggested by #LukaszDev has definitely made a big change.

Namespace 3.6 in the application descriptor file should be equal or higher than the minimum version 13.0 required by the Flex SDK

I am new to Flash Builder and setup the 4.7 environment according to these instructions: http://www.adobe.com/devnet/air/articles/ane-android-devices.html
The end of the tutorial involves "Export Release Build" of ANESampleTest (a Flex project) and I am getting this error:
"Namespace 3.6 in the application descriptor file should be equal or higher than the minimum version 13.0 required by the Flex SDK"
I do not have a good understanding of Flash/Flex/Air/etc, but following the tutorial to the letter to install Flash Builder, updating the SDK to 3.6, and the partial 'overlay' steps. How do I resolve this error message?
The fix: Change the namespace on the second line of /src/ANESampleTest-app.xml
FROM: <application xmlns="http://ns.adobe.com/air/application/3.6">
TO: <application xmlns="http://ns.adobe.com/air/application/13.0">
A brief and incomplete background:
The file /src/ANESampleTest-app.xml is the ‘application descriptor file’. When using the project files downloaded with the tutorial (that contained the 3.6 reference), the builder did not find this compatible with the configuration on my computer (a trial version I installed today - 5/3/2014 - and patched according to the tutorial). I never did figure out how to lookup valid namespaces and am still confused about how all the sdk’s relate to each other. I stumbled upon this solution by creating a fresh new project and found that the namespace specified by the new project wizard was “13.0” on this line of this file.

Automation_agent and qtp_air resource bundles not found when adding automation libs to AIR project

I'm trying to add the automation libraries to my project in Flash Builder so we can automate our testing.
I've added this to the additional compiler settings:
-include-libraries+="${flexlib}/libs/automation/automation.swc","${flexlib}/libs/automation/automation_agent.swc","${flexlib}/libs/automatio n/automation_dmv.swc","${flexlib}/libs/automation/automation_spark.swc ","${flexlib}/libs/automation/automation_air.swc","${flexlib}/libs/aut omation/automation_airspark.swc","${flexlib}/libs/automation/qtp_air.swc"
and -locale nl_BE fr_BE
After compiling this I get 2 errors:
Unable to resolve resource bundle "automation_agent"
Unable to resolve resource bundle "qtp_air"
However, in my nl_BE and fr_BE folders under flex_sdk\frameworks\locale\ the automation_agent_rb.swc and qtp_air_rb.swc are present.
If I switch to en_US, it works fine.
Can somebody explain to me why Flash Builder can't find these resource bundles?
Try explicitly adding automation_agent_rb.swc and qtp_air_rb.swc to your library-path as well.

Resources