Gradle warning: variant.getOutputFile() and variant.setOutputFile() are deprecated

Building on the answer from Larry Schiefer you can change the script to something like this: android { applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith(‘.apk’)) { def fileName = outputFile.name.replace(‘.apk’, “-${versionName}.apk”) output.outputFile = new File(outputFile.parent, fileName) } } } }

DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7

mongoose.set(“strictQuery”, false); mongoose.connect(process.env.MONGO_URL); OR mongoose.set(“strictQuery”, false); mongoose.connect(process.env.MONGO_URL, () => { console.log(“Connected to MongoDB”); }); const connectDB = async () => { try { mongoose.set(‘strictQuery’, false); await mongoose.connect(db, { useNewUrlParser: true, useUnifiedTopology: true, }); console.log(‘MongoDB Connected…’); } catch (err) { console.error(err.message); // make the process fail process.exit(1); }

Preprocessing in scikit learn – single sample – Depreciation warning

Just listen to what the warning is telling you: Reshape your data either X.reshape(-1, 1) if your data has a single feature/column and X.reshape(1, -1) if it contains a single sample. For your example type(if you have more than one feature/column): temp = temp.reshape(1,-1) For one feature/column: temp = temp.reshape(-1,1)

Getting screen width on API Level 30 (Android 11): getDefaultDisplay() and getMetrics() are now deprecated. What should we use instead?

For calculating screen width minus any system bars, this should work: public static int getScreenWidth(@NonNull Activity activity) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { WindowMetrics windowMetrics = activity.getWindowManager().getCurrentWindowMetrics(); Insets insets = windowMetrics.getWindowInsets() .getInsetsIgnoringVisibility(WindowInsets.Type.systemBars()); return windowMetrics.getBounds().width() – insets.left – insets.right; } else { DisplayMetrics displayMetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); return displayMetrics.widthPixels; } } Note that this isn’t … Read more

Django 1.9 deprecation warnings app_label

Similar error. In my case the error was: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn’t declare an explicit app_label and either isn’t in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9. class Site(models.Model): My solution was: Added ‘django.contrib.sites’ to INSTALLED_APPS

DeprecationWarning: Listening to events on the Db class has been deprecated and will be removed in the next major version

UPDATE mongodb@3.6.5 is out. Just update mongodb driver and mongoose: npm i mongodb mongoose This is caused by the mongodb@3.6.4 native driver which is used by mongoose. #1 You can downgrade mongodb to version 3.6.3 (described here). #2 Or downgrade mongoose from 5.11.16 back to 5.11.15: npm uninstall mongoose npm install mongoose@5.11.15 #3 Or just … Read more

getCurrentPosition() and watchPosition() are deprecated on insecure origins

Because switching to HTTPS can be painful or impossible depending on your architecture, I found a workaround solution: you can use the Google Maps Geolocation API. Although it has usage limits, it does the job. You will need an browser API key, so don’t forget to limit it’s usage to your page hostname. I use … Read more