In my application I have a plugin that has a file in a package that tries to import a package that exists in another fragment but with no success.
I've tried to update the exported packages in the fragment and then import the package in the plugin but have had no success.
Please advice.
You may also need to add
Eclipse-ExtensibleAPI: true to the fragment host.
Note that this is a pure-tooling header used by PDE, not an Eclipse or OSGi runtime header.
See here.
Related
I have a .app domain registered and wanted to rename android application package with .app in the part, however after I changed the package name to .aap to .app view binding is not working and can't import R class
There are two possible causes of this issue:
Incorrect Import
Build cache issue.
Incorrect Import
Generally, the ViewBinding classes are generated using the ApplicationID specified in AndroidManifest and build.gradle file.
So, there is a chance, when you changed the application ID (a.k.a. packages), the import statements for those packages are not updated.
Just update those import statements with correct package names and you are good to go.
Build cache issue
This is a common issue of build cache. Generally, the ViewBinding is created based on your Application ID specified in AndroidManifest and build.gradle file.
When you update the package name, the build cache is sometimes marked as dirty (i.e. invalid or expired). Which doesn't allow you to access some auto generated classes like ViewBindings/DataBindings/Dependency injection classes.
The only solution for this problem is performing a clean build as follow:
In this Android Studion, from the menu click on Build -> Rebuild Project.
From terminal, in your project directory perform ./gradlew clean build.
In case your project build is failing, try to temporarily comment the code base causing the build failure and try above steps again. Once your build is successful, you can now revert back the commented changes. (NOTE: While uncommenting the codebase, make sure import statements are correct, i.e. they are using the latest package name).
I am trying to setup the apk expansion setup. I added the SampleDownloaderActivity.java but I am getting these errors once I rebuild the project
import com.google.android.vending.expansion.zipfile.ZipResourceFile; does not exist
import com.google.android.vending.expansion.zipfile.ZipResourceFile.ZipEntryRO; does not exist
What is the alternative to correct this?
you have to include the expansion library separately as the code dependency, you can get the relevant code at location <sdk>/extras/google/google_market_apk_expansion/zip_file/
I'm new to kotlin, I Have an adapter class and I need to inflate a view. but recently I'm facing an error saying "Unresolved reference: R"
Like in the image below :
So, how can I inflate this view? I have imported the following:
import kotlinx.android.synthetic.main.slide_layout.view.*
But I can't figure out what should i do next, I searched everywhere, but they all seem outdated! so what should i do? Thank you!
There are two possible issues i can think of,
The first is a missing import to the R class, if your adapter is in an inner package from your domain package name, i.e.
assume this is the domain package 'your.doamin.package'
if adapter is not in that package i.e. adapter is in 'your.domain.package.adapter'
then you need to import the R class into that file, i.e write this import statement
import your.domain.package.R
That should fix your problem for this scenario
If you have already done '1' above then the other issue is, Sometimes Android studio just misbehaves, so close the file and clean and build your project by first clicking, Build -> Clean Project, once the build is done reopen that file.
For resolving the error unresolved reference: R, you are missing import of your R file. Something like
import packageName.R
For your reference, I am attaching a screenshot of the error and see the commented import.
So check where your R.java resides and import that.
First you check your class import statement in that your R class file imported or not.
import packageName.R
also you can set android studio provide auto import features. if you can enable this feature then all required class automatically import your .kt class
Unfortunately not all answers here can solve your problem, I've been looking for general solutions, you can find them
Here
FYI, I'm new to Java development and Netbeans!
I have downloaded the MigLayout jar files, both core and for swing, and added their path in the NetBeans 8.2 IDE under 'Tools->Libraries->Library_Classpath'.
My problem is that I'm trying to use the API MigLayout() but every package name that I've tried to import it results in the error "package 'Package_Name' does not exist"
The following package names fail at compile time:
import MigLayout;
import net.miginfocom.MigLayout;
import net.miginfocom.swing.MigLayout;
The following package names only fail at run time:
import net.miginfocom.layout.Grid;
import net.miginfocom.swing;
import net.miginfocom.miglayout;
Links to the MigLayout forum are broken, and none of the tutorials I've seen have the import statements. All I am asking for is a link to or list of the packages needed to use MigLayout.
If MigLayout is no longer supported, it would be nice to know that as well!
Of all packages you mentioned, the following are actually working:
import net.miginfocom.swing.MigLayout;
import net.miginfocom.layout.Grid;
It is not enough to set the jar files in the library configuration of NetBeans (Tools > Libraries). You also need to set it inside your project to get your classpath working.
In the projects view, locate the directory called Libraries (JDK will be located there) and right click on it, then click on Add Library and choose the library where you defined your jar files, in your case Library_Classpath.
I want to use jersey client in my code. I have imported the packages still and it shows an error.
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
I am using JDev environment.
Despite that when I run my code it throws:
Error(3,33): package com.sun.jersey.api.client does not exist
import com.sun.jersey.api.client.WebResource;
Any suggestion why is it throwing the error ?
first of all you have to download the library e.g. from here. Afterwards you can follow this tutorial to add the library to your project. Jersey depends also on other libraries (included in the bundle), so make sure to add them as well.