when i import mupdf 'lib' project in my app that build error,the log"Failed to resolve: com.artifex.mupdf:fitz:1.13.0" - mupdf

when i import mupdf 'lib' project in my app that build error,the log
"Failed to resolve: com.artifex.mupdf:fitz:1.13.0".
But i have already add the maven url in top build.gradle.Please tell why,thanks.

...,i tried to reboot my computer ,then,the compile is successful.It maybe the android studio's bug.I hava tried every way.But it didn't work and it cost me a half of day.

Related

Error: Could not resolve the package 'app' in 'package:app/app_controller.dart

In my last flutter project, I included files placed in my lib/ directory by using import 'package:app/file_name.dart'.
For example, my file located at lib/app_controller.dart was imported via:
import 'package:app/app_controller.dart'
I just started a new flutter project, and it is giving me the error:
Error: Could not resolve the package 'app' in 'package:app/app_controller.dart'
When I remove the portion package:app/, it builds fine. I find this very strange because my previous project is still building just fine without any changes. Does anyone know what's happening here?
What is allowing my old project to respect package:app/..., but not my new project?
package:app/ would work only for an application that is called app. What is the name of your new application? When you import items from your own project, it goes like this:
package:{{YOUR APPLICATION NAME}}/{{DIRECTORIES}}
What is the name in your pubspec.yaml file? It's usually on the very first line.
it is because a dart class can be imported in two ways(AFAIK),
local import from the root of current file where import is being used for example import '../folder/file.dart
with a package name which should begin from package for example import package:packagename/any_file_in_the_lib_folder.dart, a package will have a pubspec.yml which defines a package name which will be used to import the content of the lib folder of that package, in your case your first project is named app so it respected this import style but your second project isn't respecting it because its not named app but something else.

An unknown error occurred. could not find repository from <a valid local path> (-1)

Xcode isn't totally happy with my Package.swift file.
This is the line with an issue;
.package(name: "Utilities", url: "file:///Users/Alexander/Development/MMXX/Repositories/Utilities", from: Version("1.0.0"))
The package is a local package I have created, and is in use for a few other apps, so I know it is a valid package and its location is correct.
The Version 1.0.0 is "made up" in the sense that I haven't declared a version anywhere and didn't know what else to put there. It was the only thing I tried that Xcode was able to parse successfully -- it parsed the information, it just can't match it to my local repository.
The package was created using Xcode, and I didn't issue any commands to make it a git repository. Do I need to update my app's plist to allow disk access to a folder outside the app's sandbox?
Any pointers what else I can try would be most appreciated! Thanks.
Here is what finally worked:
in the dependencies: section
.package(path: "../Utilities")
in the targets: section
.product(name: "Utilities", package: "Utilities")
Edit:
I ran into this problem again. I dragged the package folder into the active project and it loaded the referenced libraries. But it wouldn't compile (couldn't find the new package).
Make sure you select the target and navigate to "Frameworks, Libraries and Embedded Content", click on the "+" and add the package:

Flutter NFC reader plugin does not work with error inside plugin

I'm trying to make a flutter version of my old app , it needs NFC .
First I create a default project for test run and it works fine.
I tried to use flutter-nfc-reader and install it following "Installation" in that default project.
And here comes the problem:
After I edit "pubspec.yaml" and do "packeges get" , it automatically edit "GeneratedPluginRegistrant" under "myapp/android/app/src/main/java/io.flutter.plugins".
added
import it.matteocrippa.flutternfcreader.FlutterNfcReaderPlugin;
and
FlutterNfcReaderPlugin.registerWith(registry.registrarFor("it.matteocrippa.flutternfcreader.FlutterNfcReaderPlugin"));
But the import can't find that package "it.matteocrippa.flutternfcreader" which is inside the plugin.
I tried just copy that package but that file will be full of error when it is inside my project.
I have no idea how to fix it....
As Github reads:
last step import to the project:
import 'package:flutter_nfc_reader/flutter_nfc_reader.dart';

Target URI doesn't exist, when trying to import a package in flutter

I have stumbled upon a problem in importing the package in Flutter, I tried to solve this by running flutter packages get and also shutting down the project in Android studio and reopening it.
import 'package:task_02_category_widget/category.dart';
Here is the line above, and the error I'm running into when I run it gives the following error in the console.
Your application could not be compiled, because its dependencies could
not be established.
The following Dart file:
/Users/username/Documents/flutter_rectangle_2/lib/main.dart
...refers, in an import, to the following library:
package:task_02_category_widget/category.dart
That library is in a package that is not known. Maybe you forgot to
mention it in your pubspec.yaml file?
If task_02_category_widget/category.dart is part of an old project you are reusing you should put it in a folder in your flutter application and include it like "../ folder /task_02_category_widget/category.dart ". If it is part of github repository you have copy pasted from, just copy the file and use the step above. Most probably you are looking for that . In any other case check here to find the source code.
You should have in your project at a file called pubspec.yaml a definition like this:
name: my_app
dependencies:
task_02_category_widget:
Let’s say that your package is laid out as follows:
task_02_category_widget/
lib/
category.dart
Then, you can import it:
import 'package:task_02_category_widget/category.dart';
More information:
https://www.dartlang.org/tools/pub/get-started
https://www.dartlang.org/guides/libraries/create-library-packages

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script7.groovy: 1: unable to resolve class

I am currently receiving this error when trying to run a soapui file:
org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed: Script7.groovy: 1: unable to resolve class com.company.ui.test.SoapUI_T11001_StockConsSecurityCurBusiDate # line 1, column 1.
import com.company.ui.test.SoapUI_T11001_StockConsSecurityCurBusiDate
^
org.codehaus.groovy.syntax.SyntaxException: unable to resolve class com.company.ui.test.SoapUI_T11001_StockConsSecurityCurBusiDate # line 1, column 1.
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148)
at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1206)
at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148)
at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:585)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:832)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:519)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:495)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:472)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:292)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727)
at groovy.lang.GroovyShell.parse(GroovyShell.java:739)
at groovy.lang.GroovyShell.parse(GroovyShell.java:766)
at groovy.lang.GroovyShell.parse(GroovyShell.java:757)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:141)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:90)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
1 error
soapUI code:
import com.company.ui.test.SoapUI_T11001_StockConsSecurityCurBusiDate
def env = testRunner.testCase.testSuite.project.getPropertyValue("env")
def baseUrl = testRunner.testCase.testSuite.project.getPropertyValue("baseUrl")
log.info("The baseurl is "+baseUrl)
log.info("The env under test is "+env)
SoapUI_T11001_StockConsSecurityCurBusiDate testStep = new SoapUI_T11001_StockConsSecurityCurBusiDate();
testStep.init(baseUrl);
testStep.execute(null);
eclipse code:
package com.company.ui.test;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import com.eviware.soapui.model.support.AbstractSubmitContext;
import com.eviware.soapui.model.testsuite.TestRunner;
public class SoapUI_T11001_StockConsSecurityCurBusiDate extends BaseSelenium{
public static void main(final String[] args){
final SoapUI_T11001_StockConsSecurityCurBusiDate ico = new SoapUI_T11001_StockConsSecurityCurBusiDate();
try{
ico.init("https://avncedevn1.nam.nsroot.net:17620/", false);
}catch(Exception e){
// TODO Auto-generated catch block
e.printStackTrace();
}
ico.execute(null);
}
//...code....
}
how do I solve this error ? I'm not sure what is causing the error.
This work for me:
Press Ctr+Alt+Shift+s
or:
From File menu -> Project Structure -> SDK Location -> JDK location Drop down menu choose:
Embeded JDK c:....\jre
Then ok.
If you using android studio and got this error then I solved it changing the Gradle version of the project to the newest version 6.2.1 on the project structure options.
One of the possible reasons is that the jdk version is too high. For example, using jdk 16 to build the source code of Apache Kafka throws this error. Using jdk 11 is fine.
bild.gradel file in change clashpath
dependencies {
classpath "com.android.tools.build:gradle:7.0.1"
}
gradel-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
I'm Using Android Studio - Arctic Fox and this worked for me
Go To File menu -> Project Structure -> SDK Location -> Gradle Setting
Then check the "Download external annotations for dependencies" button and select JDK location from the drop down menu and choose: Android Default Jdk Vesion.
Click on Ok.
If you wanted to make a new project on Android Studio after first install, probably you write your application name including (') sign as called apostrophe.
For Example, I tried to set a name as: "Henry's Game" but apostrophe caused Android Studio to not load because of this mistake:
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
So, just change your application's name, and simply use Latin alphabet languages such as English.
To fix: Go to your Android Project Tree and find Gradle Scripts > settings.gradle > change the name:
rootProject.name='Henry Game'
include ':app'
With Eclipse Juno (Kepler Release) Build id: 20121114-2344, I found similar problem:
org.codehaus.groovy.control.multiplecompilationerrorsexception startup failed unable to resolve class Chart
The class Chart is my container class for some utilities for charting.
I tried outside of Eclipse, with Groovy 2.0 Console the same code segment works fine. After scratching my head for about 3 hours, I resolved it by adding the following
import excel.Chart
in the invoking class with main() that has "new Chart()" thus getting the complaints, once added, the error is gone. Even more weird, after passing the error, I remove that import, there is still no more complaints! (All my scripts/classes are under the same package excel, I suppose such import statement is not needed.)
One of the symptom of the complaints is that there was not Chart.class generated in the output bin folder. Once the complaints gone, Chart.class appeared there.
I guess that it might be a bug of Eclipse/Groovy plugin (I use Groovy Plugin for Juno).
Hope my understanding is correct, and it helps.
The solution for me was change the gradle version and the Gradle JDK:
File > Project Structure > Project
enter image description here
File > Project Structure > SDK Location
enter image description here
Go to Files and click Invalidate caches/ Restart . Android studio will clear the cached and it will be restarted without any error.
Hope this answer helps you :)
For this problem, you might also encounter package naming from gsp as I did. In the build/gsptmp folder, Grails 4.x.x creates temporary gsp files to link the classes that they refer to. Due to the change of a package name it was failing to do so in my case. Try with command grails war --stacktrace during war build!
Previously, it was <%# page import="bv.BankReconciliationController" %>
but the folder bv was renamed to factoring.
So, the solve was to change the import to
<%# page import="factoring.BankReconciliationController" %> and it worked :)
I have also faced the same and tried all of the solution here and other places as well, at last i deleted my .gradle and gradle both folder and caches of android studio and open the studio again and rebuild the project, it's works after that fine and used the latest gradle version and previously it was picking up the older version and causing issues.
for me , solution is to upgrade the gradle to latest version , and remove the .idea file , and invalidate caches and restart android studio.
When starting a project make sure to select SDK version 11 or later. It will default to a minimum SDK but you have to scroll down to a later version for it to work. Then the project should load and build.
For me, I just delete the .grade file under program files(C:\Users\username\ .gradle) in windows and it will work.
This work for me:
From File menu -> Project Structure -> SDK Location -> klik Gradle Setting for show hide menu, Gradle JDK choose:
Embeded JDK c:....\jre
Then ok.
Do you have the grail and groovy plugin installed? If so try uninstalling this plugin. I had the same error message and uninstalling the plugin, restart IDE worked for me.