no `AuthorityDiscoveryConfig` in the root, Substrate - substrate

Everyone.
How are you?
I am converting the consensus engine from poa to pos on substrate node template project.
For it, I am referencing this github, https://github.com/ltfschoen/substrate-node-template/pull/4/files.
But there is one problem.
Reference project's version is 3.0.0 but my current substrate-node-template project's version is 4.0.0-dev.
So I have modified some code and tried to build it.
And I am getting this error when I build the substrate project.
error[E0432]: unresolved imports node_template_runtime::AuthorityDiscoveryConfig, node_template_runtime::SessionKeys
--> node/src/chain_spec.rs:5:2
|
5 | AuthorityDiscoveryConfig,
| ^^^^^^^^^^^^^^^^^^^^^^^^ no AuthorityDiscoveryConfig in the root
How can I solve this problem?
Please help me.
Best Regards.

Related

Getting 'no such module' error when importing a Swift Package Manager dependency

I'm running Xcode 11 Beta 4.
I'm using CocoaPods, and wanted to use one of my dependencies with Swift Package Manager as a static library instead of as a framework.
On a fresh project created with Xcode 11, the dependency can be imported successfully, but on my existing CocoaPods workspace, it does not.
I think it's likely related, but I'm also getting this link warning in Xcode:
directory not found for option '-L/Users/username/Library/Developer/Xcode/DerivedData/App-axanznliwntexmdfdskitsxlfypz/Build/Products/Release-iphoneos
I went to see if the directory exists after the warning is emitted, and it does.
I could not find any meaningful difference between the newly-created project and my old one, other than the existence of CocoaPods.
Would appreciate any pointers.
After adding a library (FASwiftUI in my case) through Swift Package Manager I had to add it to
Project Settings -> My Target ->
General -> Frameworks, Libraries, and Embedded Content
to be visible in the import statement.
I did not add any scripts for it to work.
Based on #AlexandreMorgado answer it seems like it is better to run this script in Build phases before Compile Sources. Then it works when archiving.
if [ -d "${SYMROOT}/Release${EFFECTIVE_PLATFORM_NAME}/" ] && [ "${SYMROOT}/Release${EFFECTIVE_PLATFORM_NAME}/" != "${SYMROOT}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/" ]
then
cp -f -R "${SYMROOT}/Release${EFFECTIVE_PLATFORM_NAME}/" "${SYMROOT}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/"
fi
Solution
let package = Package(
name: "PackageName",
dependencies: [
// YOU MUST ADD THE DEPENDENCY BOTH HERE [1] AND BELOW [2]
.package(url: "https://github.com/mattmaddux/FASwiftUI", from: "1.0.4")
],
targets: [
.target(
name: "PackageName",
/*[2]*/ dependencies: ["FASwiftUI"], // [2] <<<--------- Added here as well
]
)
Explanation
I'm developing a Swift package that must provide FontAwesome Icons to whoever imports it.
I was getting "No such module 'FASwiftUI'" in my SwiftUI preview canvas.
I solved it by adding "FASwiftUI" to BOTH the dependencies array of the package AS WELL AS to the dependencies array in the target itself.
Full Package.swift File
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "PackageName",
platforms: [
.macOS(.v11),
.iOS(.v14)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "PackageName",
targets: ["PackageName"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/nalexn/ViewInspector", from: "0.8.1"),
.package(url: "https://github.com/mattmaddux/FASwiftUI", from: "1.0.4")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "PackageName",
dependencies: ["FASwiftUI"], // <<<--------- Added this here
resources: [
.process("Assets")
]
),
.testTarget(
name: "PackageNameTests",
dependencies: ["PackageName", "ViewInspector"])
]
)
It turned out that Swift Package Manager implicitly depends on the project's Configuration names. I had them at live/qa instead of Release/Debug, and changing them back resolved the issue. Very odd, but I hope it saves you some trouble dear reader.
After a whole week fighting this issue, I developed a workaround using schemes and pre-actions.
I have a configuration called "Beta", so Xcode can't compile SPM dependencies. I realised Xcode compile SPM dependencies as Swift modules and add the files in Build/Products/Release-iphoneos folder in DeriverData.
So I created a scheme in Xcode and added this run script on build pre-actions:
cp -f -R "${SYMROOT}/Release${EFFECTIVE_PLATFORM_NAME}/" "${SYMROOT}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/"
This script run before the build process, copying files and modules generated by Xcode on default Release-iphoneos folder to configuration folder, Beta-iphoneos, in my case.
After coping the content from Release-iphoneos to your $configuration$-iphoneos folder Xcode should correctly compile, build and run your project.
I just ran into a similar problem and discovered that my schemes referenced old configurations, configurations that no longer existed. Once I updated them to the correct configurations the build succeeded.
(I'm leaving this comment more than a year after the original post. It's possible that what I ran into is completely different from what was originally reported. Still, it took me quite a while to track the problem down, so I wanted to leave a note that might save others time.)
Clearing the derived data solved the issue in my case. I have Microsoft Azure Devops CI Pipeline, to clear the derived data I have to edit the Xcode build task and in the "Actions" field add this command: clean.
What worked for me: I removed my import WebMIDIKit line and added it again.
Based on #sliwinski.lukas's answer, in my case the ${CONFIGURATION} was outputting "Release", so it was just copying the Release folder itself which was no good. I simply hardcoded my configuration name, and flipped Release and MyConfiguration, and it worked. I put the following code right before "Compile Sources" in the "Build Phases" tab:
cp -f -R "${SYMROOT}/MyConfiguration${EFFECTIVE_PLATFORM_NAME}/" "${SYMROOT}/Release${EFFECTIVE_PLATFORM_NAME}/" || true
Also importantly, I had to add this in the project that used the SPM and not in the main app.
I just ran into a similar problem when running xcodebuild from the command line. I was passing CONFIGURATION_BUILD_DIR=build but found that it needs to be an absolute path: CONFIGURATION_BUILD_DIR=$(pwd)/build solved the problem.
Might I shed a bit more light on your plight...
I'm working on a fairly large iOS app (6680 files) whose result is composed of many frameworks and a mixed bag of podfiles, swift packages, legacy ObjC code (that still outnumbers newer Swift stuff).
Whenever we deal with swift packages, we need to wrap them in frameworks because it simplifies podfile & dependency resolutions when we have our remote (Jenkins) build system eat everything up to spew binaries for internal QA & ultimately, Enterprise & AppStore publishing.
Earlier today, I was dealing with one such swift package wrapped in a framework and all the issues listed above hit me square in the face.
After stashing, pushing usable code and then reapplying my stashed framework wrapper to the swift package, I used a different route than opening our project's workspace where a bunch of projects and targets are collected.
Opening the lone framework wrapper seems to have kicked XCode (13.3.1) into submission and at that point, the target settings "Frameworks, Libraries and Embeddable" section was actually able to display the swift package's "Foo" binary. Added it, and then everything was playing nice.
So, if you're still having problems, try simplifying the problem by opening smaller morsles if you can. Or start making these wrapper frameworks (if it's at all possible) so that you can actually manage smaller bites before integrating them on XC's platter.
For me, I go to Xcode -> File (The one on mac top bar) -> Packages -> Update to Latest Package Versions. This solved my problem.
In order to keep incremental builds working I had to specify the output files of "Fix SPM" build phase like so:

How to use go module as dependency in go dep project?

I have Go dep project. I want to use go module as dependency. For example. I need this one https://github.com/pion/webrtc.
So, I try to declare the dependency like this, in Gopkg.toml:
[[constraint]]
name = "github.com/pion/webrtc"
revision = "6a0b7020b1724dcb302ddfadab0c80fabc144c97"
When I do dep ensure, I got errors:
Solving failure: No versions of github.com/pion/webrtc met constraints:
6a0b7020b1724dcb302ddfadab0c80fabc144c97: "github.com/pion/webrtc" imports "github.com/pion/webrtc/v2/pkg/rtcerr", which con
tains malformed code: no package exists at "github.com/pion/webrtc/v2/pkg/rtcerr"
v2.0.14: Could not introduce github.com/pion/webrtc#v2.0.14, as it is not allowed by constraint 6a0b7020b1724dcb302ddfadab0c
80fabc144c97 from project ***.
v2.0.13: Could not introduce github.com/pion/webrtc#v2.0.13, as it is not allowed by constraint 6a0b7020b1724dcb302ddfadab0c
80fabc144c97 from project ***.
It seems, that the problem is connected with 2 version of library. When it was 1, everything works fine.
Thanks for using Pion :)
We had the same issue opened on Pion WebRTC issue tracker. There is a PR to fix dep for this case.
If possible I would switch to modules though, but in the meantime hopefully using this patched version of dep should help!

Please solve appcompat_v7 error

My Android Support Library is properly installed by SDK Manager.
Using this link I doing this procedure.
Selecting Adding Library with recources - Using Eclipse > doing these procedure.
After I finish, created "android-support-v7-appcompat" file in Eclipse.
android-support-v7-appcompat > res > values-v21 > styles_base.xml >
<style name="Base.Widget.AppCompat.ActionButton"
parent="android:Widget.Material.ActionButton">
</style>
this line creating with error. How I can fix this problem?
I read some question about appcompat_v7 error but I can not fix it yet.
Please tell me effective way to solve it forever.
You need to remove the android-v4 jar file under the libs folder,and add it from the android-support-v7-appcompat libs folder. I had this problem before,and I found it so annoying!
If in console the error is
Error retrieving parent for item: No resource found that matches the
given name 'android:Widget.Material.ActionButton'
, on android-support-v7-appcompat library project choose Properties/Android/Project Build Target and set checkbox on Android 5.0 to solve.

Gradle Multi-Project Setup Layout - Multiple Dependencies

I'm converting an existing java multimodule project to gradle. The dependencies are a bit complicated - in short, I have something along these lines:
Root project MainProject
+--- Project ':P1'
| \--- Project ':P1:P2'
\--- Project ':utilProject'
So, my mainProject depends on P1, which in turn depends on P2, and a utilProject.
The thing is, both P1 and P2 also depend on the utilProject.
In the build.gradle for each of these projects was just compiling the ':utilProject' (the project is always in the root, and the projects for the main one look as I wrote above):
dependencies {
compile project(':utilProject')
// compile some other dependencies
}
P1 and P2 are fine (compiling without errors), however the main project won't compile. I've tried changing the code in utilProject around, and found that while the utilProject itself does compile the latest changes, the the main project is blind to them.
Any ideas would be greatly appreciated.
/// Update - July 20th 2014
Forgot to mention the MainProject is an eclipse plugin, and so we use the wuff plugin to compile (though I'm not sure it's relevant).
Seems like there is no need for P2 - P1 won't compile either (previously it just didn't use that bit of updated code. My bad).
Also, while I wasn't able to reproduce, I was able to find a workaround - adding the latest utilProject.jar to the dependency list seems to do the trick. I'm not sure why it's necessary... any ideas? Note that I did have to add the P1.jar to the MainProject and so on to make things work, which seems to indicate something's wrong with the dependency list, but all the projects on that list compile just fine.

Compile iReport 4.0.2 from sources with NetBeans 6.5.1 java.io.IOException

I am trying to compile iReport 4.0.2 with NetBeans 6.5.1. On the iReport forums it says that this is the NetBeans platform to which it is compatible.
However, I get this error when compiling the project:
C:\Program Files\NetBeans 6.5.1\harness\suite.xml:106: The following
error occurred while executing this line:
C:\Program Files\NetBeans
6.5.1\harness\build.xml:98: java.io.IOException: No definition of netbeans.dest.dir in
V:\iReport-4.0.2-src\iReport-4.0.2-src\jasperreports-components
This is the line 106 in suite.xml
<subant target="netbeans" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false"/>
This is the line 98 in build.xml:
>
... it is basically closing an xml start tag (parseprojectxml) - this is the context of the line (the single angle bracket):
<parseprojectxml
project="."
publicpackagesproperty="public.packages"
friendsproperty="friends"
javadocpackagesproperty="module.javadoc.packages"
moduledependenciesproperty="module.dependencies"
moduleclasspathproperty="module.classpath"
publicpackagejardir="${public.package.jar.dir}"
modulerunclasspathproperty="module.run.classpath"
classpathextensionsproperty="class.path.extensions"
>
<testtype name="unit"
folder="test.unit.folder"
runtimecp="test.unit.runtime.cp"
compilecp="test.unit.compile.cp"
compiledep="test.unit.testdep"/>
<testtype name="qa-functional"
folder="test.qa-functional.folder"
runtimecp="test.qa-functional.runtime.cp"
compilecp="test.qa-functional.compile.cp"
compiledep="test.qa-functional.testdep"/>
</parseprojectxml>
I also faced the above problem in iReports trunk version (> 4.6.0). After marking off read only mode (which the solution of previous answer do), you might need to add
<nbmproject2:property name="netbeans.dest.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
in jasperreports-extensions and MongoDbPlugin.
Gaurav J
The problem was somehow solved by opening each module in NetBeans IDE, then opening the properties dialog and clicking OK for each module. I restarted the IDE and then I managed to run the project.
If someone can exaplain what caused the problem and why my actions managed to solve it... I would like to have an explanation for this behavior.
Thank you!
I can compile ireport with NetBeans success.I think you must modify file with name "platform-private.properties"

Resources