error: package com.mapbox.mapboxandroiddemo.R does not exist - android-studio

When I try to run Mapbox offline and use their template from there website :
https://docs.mapbox.com/android/maps/examples/download-a-simple-offline-map/
I keep getting this error, I tried to google a few things but there was no proper answer - the closest i got was this:
https://github.com/mapbox/mapbox-gl-native/issues/16102
This is the error :
error: package com.mapbox.mapboxandroiddemo does not exist
import com.mapbox.mapboxandroiddemo.R;
Any help would be much appreciated

Delete the import com.mapbox.mapboxandroiddemo.R; line at the top of your file. This should then let your Android Studio suggest a new import of your project's R import line, rather than https://github.com/mapbox/mapbox-android-demo 's

Related

How to resolve "Unable to import 'requests'pylint(import-error)" in Visual Studio Code IDE?

I'm a newbie to Visual Studio Code and Python. I have this "import requests" line at the top of my helloworld.py. It clicked on the "Peek Problem" of the "import request", it shows the "Unable to import 'requests'pylint(import-error)". When I run the helloworld.py file in VSC, it shows this error.
import requests
ModuleNotFoundError: No module named 'requests'
I tried:
To isolate VSC, I tried import requests in Python3 interpreter and I got the same error.
By the way, I'm not using virtual environment. I have also looked at the following pages but I still couldn't get this error resolved.
https://code.visualstudio.com/docs/python/linting#_specific-linters
https://github.com/Microsoft/vscode-python/issues/1185
https://donjayamanne.github.io/pythonVSCodeDocs/docs/troubleshooting_linting/
https://www.codeproject.com/Questions/1070423/How-to-import-REQUESTS-module-in-Python
I was facing the same issue. Following these steps resolved my issue:
Look for python3 in the venv/bin folder of your current project. For me the path looked like this:
/Users/your-user/this-vscode-project/.venv/bin/python3
Now open the .vscode/settings.json. Now add this to the existing json:
"python.pythonPath": "path from above"
Save the code & Run it again!

unused import in android studio

I created a dart file while importing in main dart file it'showing the error unused import try to import the directive.how to import the problem?
Android studio is very smart IDE.
In your code you have imported task.dart file but that file is not in use. (You are not using any resource of that class.)
So if you remove that class from your file you will have a batter and clean code, also at compile time that file will be not imported in your code.
Which is best practice.
that's not an error that a warning .
you can delete your import "task.dart" to remove the warning

How do I make GlideApp Compatible with androidx?

I recently migrated my app from AppCompat to Androidx but now I'm facing a serious issue with GlideApp. Whenever I try building the project, it shows compilation failed.
I tried changing the following import statements,
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
in the build folder to:
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
But whenever I rebuild it just regenerates the former import statement and returns the following errors:
error: package android.support.annotation does not exist error:
cannot find symbol class NonNull
I found the fix by adding annotationProcessor 'androidx.annotation:annotation:1.1.0' to my dependencies in app build.gradle and was able to build the project with no errors.
Got the solution from here: https://github.com/bumptech/glide/issues/3080#issuecomment-426331231

How to fix "ImportError: cannot import name 'flags' " while importing flags from Cleverhans.compat in Python

I am having a problem while playing the following code given as example in Cleverhans Library :
The problem is on Line # 18 . When it plays it gives out an import error :
ImportError: cannot import name 'flags'
I have tried to see in the help and there is also no flags function listed there.
from cleverhans.compat import flags
This should work by simply importing the module and giving no error.
I found the solution.
If any such error appears then its due to the problem in the way you have set your environment to work in .
If the dependencies are perfectly aligned then there comes no such error.
Thanks :)
P.S. If you find such error while running your code in Cleverhans then drop me a message . I'll be happy to help :)
To anyone that needs a solution:
replace from cleverhans.compat import flags with from tensorflow.python.platform import flags
if you are using pycharm, maybe you should open all the project 'cleverhans-master', and right-click on it,select mark directory as---source root. And it could be imported normally.

ImportError: No module named 'PyQt4.QtWebKit'

I'm trying to setup Ghost.py and I need PyQt4 for it.
I've downloaded PyQt-x11-gpl-4.11.3 version and used configure-ng.py with Python-3.4.2, of course did make and make install.
Sadly, I'm getting an error ImportError: No module named 'PyQt4.QtWebKit' while trying to from ghost import Ghost.
Can't figure out how do I build QtWebKit.
Thank you for any useful input!

Resources