I am using Android Studio Arctic Fox(2020.3.1).
I've been having some trouble with handler.java
Most of the errors are
'android.annotation.NonNull' is not public in 'android.annotation'. Cannot be accessed from an outside package
I've tried to fix android with androidx. but I don't know why this error occurs. please help me.
that's not important!
you will get these kinds of errors when navigating android source.
that won't affect your android project and everything will be compiled successfully ✔
I guess you need to import androidx.annotation.Nullable and make sure you have declared a dependency on androidx.annotation:annotation in your build.gradle, check here to find the last version.
Related
Please forgive the vague sounding title
I am trying to get this project to compile in android studio:
https://proandroiddev.com/how-to-create-a-bubble-selection-animation-on-android-627044da4854
https://github.com/igalata/Bubble-Picker
Downloading the github project and compiling it as it is did not work, I am getting this error, and redownloading dependencies and syncing as suggested in the error message did not work
UPDATE: I have upgraded android studio, gradle and kotlin plugin to latest version and it's still the same problem.
I can use the library version of this project just fine, using the steps described in the github page. I want to compile the source code of this component together with my project so that I can tweak the bubble animation itself. Since the github project itself does not compile, I created a Hello World project first, then manually copied in the bubblepicker folder in the Hello World project. Inside the bubblepicker folder, I changed the name of the folder tree java/com/iglata/bubblepicker to java/com/test/app/bubblepicker, and changed the package name of the files inside this folder to reflect this. I then copied the code in DemoActivity.kt to my MainActivity.kt and changed the package names and made few minor adjustments to make the compiler errors go away.
I have made some modifications in the gradle files as well so that gradle syncing does not give any errors. However, anything inside bubblepicker does not seem to be detected in the MainActivity.kt, or it's activity layout xml file. For example,
import com.test.app.bubblepicker.BubblePickerListener
is marked with red colour in android studio and the error is unresolved reference. If I remove all references to bubblepicker and replace the code in MainActivity.kt with the Hello World code, then it compiles and runs fine, so it's as if bubblepicker is not getting picked up by the compiler at all.
What could be the problem here?
Or at the very least, how can I compile the bubblepicker github project? Simply loading the whole project in Android Studio is giving me compiler errors. I am doing this on Android Studio 3.5 on macOS with Kotlin version latest as of September 4.
I didn't get any error while import Github project.
Kindly update your android studio and kotlin Gradle version and check same.
I recently had to reimport my android project, which consists of both .java and .kt files, into Android Studio. After the import Android Studio tries to import only some Kotlin dependencies into .java files, what obviously doesn't work.
The same code had worked before, what makes me think I may be missing some setting in Android Studio, about how Java and Kotlin interact or something like that?
Edit: On the other hand I'm able to build my app and also deploy to a device without problems, but Android Studio still keeps complaining.
Check your kotlin version(make sure that you have the latest one ) then clean and rebuild your app
try to hard-import
import java.lang.Deprecated;
but I think you can resolve this issue by the way clean and rebuild your project
I have an activity in which i have imported android.os.storage.DiskInfo and some other packages. Android Studio gives errors when trying to make the project saying:
error: cannot find symbol class DiskInfo
When i tried to resolve this problem i found out that all packages are present in folder $SDK-HOME\sources\android-24\android\os\storage but i don't know why Studio couldn't import them properly.
Is there anybody who have experienced problems in import and have solved it?
Thanks
p.s: i am using Android API 24
That is because of #hide in android source code. Actually Android is not allowing developers to use some classes. A solution is to use modified SDK which contains hidden classes. you can find it here https://github.com/anggrayudi/android-hidden-api
Check out : TargetSdk version and support package version.
I am using Android Studio 0.8.14, and I have included the module from https://chris.banes.me/2012/10/12/photoview-v1-1/ but it always show me
Error:(27, 29) error: package uk.co.senab.photoview does not exist
But within the program the import uk.co.senab.photoview.PhotoViewAttacher; without any error.
That's puzzled me.
I have been trying to resolve this without any success.
you should check first: Package does not exist when using separate App as a dependency
then - if this does not fix your issue you should create a dependancy of your library:
reference which helped me to solve this problem:
https://www.jetbrains.com/idea/help/configuring-module-dependencies-and-libraries.html
in this case you should add : [your-photo-library-name] dependancy for your main app in Project Structure Screen.
Hope it helps.
I have imported the android api sample applicaition into Eclipse. I am getting compile error in import and where ever this R is used. Api levels are fine, I couldnt see R.class is getting generated. Please spot my prob and help me out fix this.
`import com.example.android.apis.R;`
clean the project(go to project->clean)...if not solved
manually add the library(right click project->properties-->search for 'java build path)
I finally debugged why this hasn't been building. (I had it running in older SDKs.)
After trying the various suggestions here to no avail, I found that the project is missing the accessibility_node_provider_instructions string resource from res/values/strings.xml. Plus it also needed the android-support-v4.jar library for PrintBitmap.java.
This is with Android 4.4.2 (API 19).
Check if the package name in the manifest tag of AndroidManifest.xml is correct com.example.android.apis
If you have created the api samples project via. eclipse -> New ->Android Sample Project you should not have any project with package.
The jre system libray was not added in the project, once added the issue get resolved.