i try for 2 days to generate a documentation on android studio Bumblebee, i have try multiples possibility, generate documentation with -sourcepath /path/android.jar, command line in shell javadoc with just a class.java, select Jdk embedded in build deployment gradle, custom scope project, and more... but i have the same problem :
error: package does not exist
error: cannot find symbol
error: static import only from classes and interfaces
have you a solution ? thank you for helping me
Related
This question already has an answer here:
Migrate resource files to Androidx
(1 answer)
Closed 3 years ago.
I've have recently migrated my app to AndroidX, blindly without knowing the ins and outs. As a result every time I run the project, it gives me a load of errors.
I have updated all my Gradle Dependencies and targetSDK to the most recent version code. I have also added the following to gradle.properties:
android.useAndroidX=true
android.enableJetifier=true
But this has still made no difference.
Some of the following are examples of errors I am getting:
error: package android.support.annotation does not exist
error: package android.support.v7.widget does not exist
error: package RecyclerView does not exist
error: cannot find symbol class FragmentActivity
error: cannot find symbol class CardView
error: cannot find symbol class FragmentPagerAdapter
error: cannot find symbol class DialogFragment
I would just like to know I can get rid of these errors, as it is stopping me from running the project on my mobile device?
Here you can find the full class mapping.
In your case you have to change the imports:
error: package android.support.annotation does not exist
error: package android.support.v7.widget does not exist
Packages:
package androidx.annotation.*;
package androidx.appcompat.widget.*;
Classes:
android.support.v4.app.FragmentActivity androidx.fragment.app.FragmentActivity
android.support.v7.widget.CardView androidx.cardview.widget.CardView
android.support.v4.app.FragmentPagerAdapter androidx.fragment.app.FragmentPagerAdapter
android.support.v7.app.AppCompatDialogFragment androidx.appcompat.app.AppCompatDialogFragment
android.support.v7.widget.RecyclerView androidx.recyclerview.widget.RecyclerView
You seem to have everything set up correctly in your gradle file. The problem is that there are missing packages that have not yet been converted/migrated to AndroidX. Here's a little trick you can do:
Go to your app.gradle file and right-click anywhere.
Select Refactor on the menu that pops up.
In the sub-menu, select Migrate to AndroidX
Sit back and let Android studio migrate all your files.
To learn more, check this out.
I hope this helps. Merry coding!
In the Android Studio menu go to Refactor and select Migrate to AndroidX.
Rest the android studio will automatically do.
Other than this if you still find the error then you will have to manual perform certain task.
In the layout find all the old one and replace it like
android.support.v7.widget.CardView
with
androidx.cardview.widget.CardView
you will find the mapping related information here https://developer.android.com/jetpack/androidx/migrate/class-mappings
just find the old text by using Ctr+F and copy the replacement text
In the app build
implementation 'com.android.support:cardview-v7:28.0.0'
with
implementation 'androidx.cardview:cardview:1.0.0'
you will find mapping related information here https://developer.android.com/jetpack/androidx/migrate/artifact-mappings
I'm new in Android SDK. I'm using Emacs as IDE (I know about Android Studio). I created a project and I compiled it from a script named gradlew (It was created automatically when the project was created). APK is created successfully. Now, I'm trying to implement (with FlyMake) syntax error checker. The command used to do this is the following:
javac "main.java"
where main.java is the main of the application (there is only one file).
Obviously, javac doesn't know where is the SDK (API level 20). So I tell it as follow:
javac -sourcepath "~/opt/android/sources/android-20" "main.java"
but it throws a lot of errors like "class not found". For example:
/home/carlos/opt/android/sources/android-20/android/app/Activity.java:29: error: cannot find symbol
import android.content.IIntentSender;
^
symbol: class IIntentSender
location: package android.content
When I see the content of android/content, there is not a .java named IIntentSender
So, what's happening? Thanks for reading and answering!
This question was answered by CommonsWare:
The last time I used javac by hand, I used -classpath, not -sourcepath. The appropriate JAR for -classpath would be ~/opt/android/platforms/android-20/android.jar, assuming that ~/opt/android/ is where your Android SDK is installed. IIntentSender is generated Java source code (from AIDL) and will not be in Java form in the SDK sources directory. So, if FlyMake requires -sourcepath, I expect that you're going to be in a world of hurt.
Thanks!
I am developing an application using Spring Boot. It is fairly straightforward. It uses Quartz to schedule Pentaho jobs to import data into a Postgres database. It contains only 1 module(the original, no extras have been added. The project started out using Java 7 but within the first couple of weeks switched to Java 8. After the switch, everything ran fine(i.e the application would compile and launch). I started coding some new classes and when they were completed, I went to test them and the application wouldn't compile. I got an error stating that Java 8 was the wrong source code. I checked my project structure and both Global and Module compilers were set to Java 8. I did find that Gradle was still using Java 7. I changed Gradle to Java 8 and the error changed. The compile was still failing due to the following errors:
• error: package org.quartz does not exist import org.quartz.*;
• error: package org.quartz does not exist import org.quartz.*;
• error: package org.quartz does not exist import org.quartz.*;
• error: package org.quartz.impl does not exist import org.quartz.impl.StdSchedulerFactory;
• error: package org.quartz.impl.matchers does not exist import org.quartz.impl.matchers.GroupMatcher;
• error: package org.pentaho.di.job does not exist import org.pentaho.di.job.JobMeta;
• error: package org.pentaho.di.core.exception does not exist import org.pentaho.di.core.exception.KettleException;
• error: package org.pentaho.di.core does not exist import org.pentaho.di.core.Result;
• error: package org.pentaho.di.core does not exist import org.pentaho.di.core.KettleEnvironment;
Quartz and Pentaho are not being found even though they are set up in the Project Structure:
I am fairly new to IntelliJ so any suggetions on what else to check or how to proceed would be greatly appreciated.
This can solve your problem. First clean your gradle project. After that you will need to refresh all your gradle deps by clicking on this blue arrows in gradle tool window.
I am not sure if you found a solution, but I was experiencing a similar situation. I tried to remove current modules in the project settings, then added the project modules again. I then refreshed my Gradle and rebuilt my project.
Which JAR contains org.jboss.netty.channel.socket.nio?
I'm not using Maven or Ivy, just Ant.
Ant compile gives:
-do-compile:
[javac] Compiling 4 source files to /home/thufir/NetBeansProjects/EchoClient/build/classes
[javac] /home/thufir/NetBeansProjects/EchoClient/src/net/bounceme/dur/netty/client/ObjectEchoClient.java:3: error: package org.jboss.netty.channel.socket.nio does not exist
[javac] import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
In the classpath is:
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$ head -n 58 project.properties | tail -n 29
endorsed.classpath=
excludes=
file.reference.netty-all-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/all-in-one/netty-all-4.0.21.Final-sources.jar
file.reference.netty-all-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/all-in-one/netty-all-4.0.21.Final.jar
file.reference.netty-buffer-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-buffer-4.0.21.Final-sources.jar
file.reference.netty-buffer-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-buffer-4.0.21.Final.jar
file.reference.netty-codec-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-4.0.21.Final-sources.jar
file.reference.netty-codec-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-4.0.21.Final.jar
file.reference.netty-codec-http-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-http-4.0.21.Final-sources.jar
file.reference.netty-codec-http-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-http-4.0.21.Final.jar
file.reference.netty-codec-socks-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-socks-4.0.21.Final-sources.jar
file.reference.netty-codec-socks-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-socks-4.0.21.Final.jar
file.reference.netty-common-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-common-4.0.21.Final-sources.jar
file.reference.netty-common-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-common-4.0.21.Final.jar
file.reference.netty-example-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-example-4.0.21.Final-sources.jar
file.reference.netty-example-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-example-4.0.21.Final.jar
file.reference.netty-handler-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-handler-4.0.21.Final-sources.jar
file.reference.netty-handler-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-handler-4.0.21.Final.jar
file.reference.netty-tcnative-1.1.30.Fork2-linux-x86_64.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-tcnative-1.1.30.Fork2-linux-x86_64.jar
file.reference.netty-tcnative-1.1.30.Fork2-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-tcnative-1.1.30.Fork2-sources.jar
file.reference.netty-transport-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-4.0.21.Final-sources.jar
file.reference.netty-transport-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-4.0.21.Final.jar
file.reference.netty-transport-rxtx-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-rxtx-4.0.21.Final-sources.jar
file.reference.netty-transport-rxtx-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-rxtx-4.0.21.Final.jar
file.reference.netty-transport-sctp-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-sctp-4.0.21.Final-sources.jar
file.reference.netty-transport-sctp-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-sctp-4.0.21.Final.jar
file.reference.netty-transport-udt-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-udt-4.0.21.Final-sources.jar
file.reference.netty-transport-udt-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-udt-4.0.21.Final.jar
includes=**
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$
The library is netty-4.0.21.Final.tar.bz2, which was downloaded from the official Netty website.
I added each JAR from that download to the project. Yes, I realize it's not using the CLI javac classpath, but the JAR's are visible in the project, as well as in the output above.
I looked through some of the JAR's and was unable to find this specific class.
You seem to be trying to build an application developed against Netty 3.x using Netty 4.0.
There have been API changes, including channel creation and bootstrap. Also, the package prefix changed from org.jboss.netty to io.netty reflecting the project status change.
Use the API documentation (which no longer documents NioClientSocketChannelFactory) corresponding to the release you're using and checkout the provided examples (netty-example-4.0.21.Final-sources.jar) to help port any code you have that's built against Netty 3.x.
I want to generate headers using javah but when i do i get an error:
Error: cannot access android.support.v4.app.FragmentActivity
class file for android.support.v4.app.FragmentActivity not found
I created new External Tool with this parameters:
Location: D:\Android\jdk1.7.0_51\bin\javah.exe
Working Directory: D:\Android\workspace\MyApp\bin\
Arguments: -d D:\Android\workspace\MyApp\jni -classpath D:\Android\workspace\MyApp\bin\classes;D:\Android\workspace\appcompat_v7\libs\android-support-v7-appcompat.jar com.example.myapp.MainActivity
I use last version of Android SDK and NDK as last version of Java.
Any suggestions?
This can be solved by adding android-support-v4.jar to your javah class path arguments.
I am not an Android developer, this was a result of hunting around on Google (for example, information derived indirectly from the answer to IntelliJ 12 + ActionBarSherlock setttings: Could not find class 'android.support.v4.app.FragmentActivity'). I do not know why this is required in addition to standard v7 jars, and I am posting this answer as community wiki in hopes that somebody with more experience can edit it to add some more information in the future.