Import errors of project Tower-develop - android-appcompat

I downloaded project "Tower-develop" from github and import to eclipse.
I also import "android-support-v7-appcompat", and then add this library into project "Tower-develop".
But I found the following errors:
"No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'"
and
"error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.DropDownItem.Spinner'."
I checked "android-support-v7-appcompat", and found package "android.support.v7.appcompat" is empty.
That maybe the cause of those errors. But I don't know how to fix it.

Related

How to import a module from parent directory within a subdirectory

I was working on a simple project, bike_rentals. I thought all was well until I began writing test files for the project.
I created a new directory and name it TestBikeRental and saved it within the BikeRentals directory, which contained the scripts for my project. I created the file init.py within the BikeRentals and TestBikeRentals directory to make them each be a package. Within the top directory is the script run_script.py that I use to run the modules\scripts contained in the package BikeRentals.
Directory structure
The problem comes up when I try to import the py script db_connection (underlined in yellow), within the Test_bike_rentals.py.
This is how tried to imported db_connection.
Importing db_connection
After numerous and numerous attempts, the errors that I kept receiving were these two:
from BikeRentals.BikeRentals.db_connection import Connect
ModuleNotFoundError: No module named 'BikeRentals'
from..db connection import Connect
ImportError: attempted relative import with no known parent package
To view the sourcecode in github repo:
https://github.com/Brownred/Python-and-SQL
I tried to import a module but got an error after numerous attempts. I was expecting no error when it comes to importing a module.

error: package com.mapbox.mapboxandroiddemo.R does not exist

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

Haskell: same module found twice - "Ambiguous module name"

I have the following import in a haskell file. I'm using cabal.
import Network.Wai (Application, Response, rawPathInfo, responseFile, responseLBS, requestBody)
But I'm getting this error when I try to build the file:
Error: Ambiguous module name ‘Network.Wai’:
it was found in multiple packages: wai-3.2.2.1 wai-3.2.2.1
Note that the multiple packages are exactly the same. Something like -XPackageImports doesn't work here, because for some reason the same package is installed twice.
I opened up /Users/<user>/.cabal/store/ghc-8.6.5/package.db and sure enough, there were two "w" (wai) packages with the same version but different hashes. I deleted one and this didn't fix it.

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!

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

Resources