About Kotlin Multiplatform AndroidNative who can help me. I searched kotlinlang, stackoverflow, google, but there was no specific way to use it - kotlin-native

I want to implement the library generated by Android calling AndroidNativeArm64 in the Kotlin Mulitplatform project. I've gone through almost all the documentation at kotlinlang.org and still don't know how to do it. Also searching on google and stackoverflow and github, no good reference. Is there an example of this? I tried a few things on my own, but it went wrong.
I did the following in the IntelliJ IDE:
enter image description here
enter image description here
enter image description here
Configure gradle according to the documentation to produce klib and so files:
enter image description here
https://kotlinlang.org/docs/multiplatform-library.html#publish-your-library-to-the-local-maven-repository
The library has been published to the local Maven repository:
/Users/dxy/.m2/repository/me
└── dxy
├── mytestlib
│ ├── 1.0.0
│ │ ├── mytestlib-1.0.0-kotlin-tooling-metadata.json
│ │ ├── mytestlib-1.0.0-sources.jar
│ │ ├── mytestlib-1.0.0.jar
│ │ ├── mytestlib-1.0.0.module
│ │ └── mytestlib-1.0.0.pom
│ └── maven-metadata-local.xml
└── mytestlib-androidnativearm64
├── 1.0.0
│ ├── mytestlib-androidnativearm64-1.0.0-sources.jar
│ ├── mytestlib-androidnativearm64-1.0.0.klib
│ ├── mytestlib-androidnativearm64-1.0.0.module
│ └── mytestlib-androidnativearm64-1.0.0.pom
└── maven-metadata-local.xml
5 directories, 11 files
Create the Kotlin Mulitplatform App in AndroidStudio.
https://kotlinlang.org/docs/multiplatform-library.html#add-a-dependency-on-the-published-library
Error adding dependencies to androidMain:
enter image description here
Unable to build Kotlin project configuration
org.gradle.internal.resolve.ArtifactNotFoundException: Could not find mytestlib-1.0.0-samplessources.jar (me.dxy:mytestlib:1.0.0).
Searched in the following locations:
file:/Users/dxy/.m2/repository/me/dxy/mytestlib/1.0.0/mytestlib-1.0.0-samplessources.jar
at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:28)
at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveArtifact(ExternalResourceResolver.java:510)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$ResolveAndCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:439)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.LocalModuleComponentRepository$LocalAccess.resolveArtifact(LocalModuleComponentRepository.java:91)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.lambda$resolveArtifact$12(ErrorHandlingModuleComponentRepository.java:171)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.tryResolveAndMaybeBlacklist(ErrorHandlingModuleComponentRepository.java:227)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.performOperationWithRetries(ErrorHandlingModuleComponentRepository.java:193)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveArtifact(ErrorHandlingModuleComponentRepository.java:169)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainArtifactResolver.resolveArtifact(RepositoryChainArtifactResolver.java:78)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultArtifactSet$LazyArtifactSupplier.calculateValue(DefaultArtifactSet.java:290)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultArtifactSet$LazyArtifactSupplier.calculateValue(DefaultArtifactSet.java:261)
at org.gradle.internal.model.CalculatedValueContainer$CalculationState.lambda$attachValue$0(CalculatedValueContainer.java:218)
at org.gradle.internal.Try.ofFailable(Try.java:41)
at org.gradle.internal.model.CalculatedValueContainer$CalculationState.attachValue(CalculatedValueContainer.java:213)
at org.gradle.internal.model.CalculatedValueContainer.finalizeIfNotAlready(CalculatedValueContainer.java:186)
at org.gradle.internal.model.CalculatedValueContainer.finalizeIfNotAlready(CalculatedValueContainer.java:177)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ArtifactBackedResolvedVariant$DownloadArtifactFile.run(ArtifactBackedResolvedVariant.java:192)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$QueueWorker.execute(DefaultBuildOperationExecutor.java:238)
at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.runOperation(DefaultBuildOperationQueue.java:266)
at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.doRunBatch(DefaultBuildOperationQueue.java:247)
at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.lambda$runBatch$0(DefaultBuildOperationQueue.java:237)
at org.gradle.internal.resources.AbstractResourceLockRegistry.whileDisallowingLockChanges(AbstractResourceLockRegistry.java:50)
at org.gradle.internal.work.DefaultWorkerLeaseService.whileDisallowingProjectLockChanges(DefaultWorkerLeaseService.java:221)
at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.lambda$runBatch$1(DefaultBuildOperationQueue.java:237)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)
at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.runBatch(DefaultBuildOperationQueue.java:223)
at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.run(DefaultBuildOperationQueue.java:191)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

Related

How to use assets files that are outside the javascripts and stylesheets directory in grails?

I would like to use third-party libraries in a grails project.
In order to use a third-party library, I have to copy the css and javascript files of the third-party library to the stylesheets and javascripts directories in the assets of grails-app respectively because as far as I understand that the Grails framework requires css and javascript files to be in the stylesheets and javascripts directories in the assets of grails-app respectively.
Then, they should be linked in the following way in a view/gsp file. For example:
<asset:stylesheet href="application.css"/>
<asset:stylesheet href="main.css"/>
<asset:javascript src="application.js"/>
My question is, is there any way to link assets files that are outside the javascripts and stylesheets directory in grails?
For instance:
How can I link the css/style.css file in a view/gsp file?
An example project structure:
grails-app
├───assets
│ ├───css
│ │ style.css
│ ├───images
│ │ favicon.ico
│ │ grails.svg
│ │ spinner.gif
│ ├───javascripts
│ │ application.js
│ │ bootstrap.js
│ │ jquery-3.3.1.min.js
│ └───stylesheets
│ application.css
│ bootstrap.css
│ grails.css
│ main.css
├───conf
├───controllers
├───domain
├───i18n
├───init
├───services
├───taglib
├───utils
└───views
Or should I use the external tag after installed the Resources plugin?
The solution is to create themes directory in the assets.
Then static assets will be called in the following way.
<asset:stylesheet href="test.css"/>
<asset:javascript src="test.js"/>
<asset:stylesheet href="admin/test.css"/>
<asset:javascript src="admin/test.js"/>
A project structure looks like the following:
grails-app
├───assets
│ ├───images
│ │ favicon.ico
│ │ grails.svg
│ │ spinner.gif
│ │
│ ├───javascripts
│ │ application.js
│ │ bootstrap.js
│ │ jquery-3.3.1.min.js
│ │
│ ├───stylesheets
│ │ application.css
│ │ bootstrap.css
│ │ grails.css
│ │ main.css
│ │
│ └───themes
│ ├───admin
│ │ ├───css
│ │ │ test.css
│ │ │
│ │ └───js
│ │ test.js
│ │
│ ├───css
│ │ test.css
│ │
│ └───js
│ test.js
│
├───conf
├───controllers
...

Pod lib lint did not pass validation xcodebuild: ld: warning: ignoring file missing required architecture i386 in file

Recently, I'm trying to use CocoaPods to upload an integrated sharedSDK to a private library.
I'm not sure if I'm doing something stupid. When I run "pod lib lint", everything seems to be fine but when I run "pod spec lint" I get:
ld: warning: ignoring file by TencentOpenAPI.framework
** BUILD FAILED **
The following build commands failed:
Ld /Users/melody/Library/Developer/Xcode/DerivedData/App-fcbstzvalzvjwfgtkwkycnyvprjk
/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App normal i386
(1 failure)
-> SLShareSDK (0.1.0)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | [iOS] xcodebuild: ld: warning: ignoring file /Users/melody/GItLab/SLShareSDK/SLShareSDK/Assets/TencentOpenAPI.framework/TencentOpenAPI,
missing required architecture i386 in file /Users/melody/GItLab/SLShareSDK/SLShareSDK/Assets/TencentOpenAPI.framework/TencentOpenAPI (3 slices)
- NOTE | [iOS] xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation)
[!] SLShareSDK did not pass validation, due to 1 error.
The contents of my SLShareSDK.Sperepo file are
Pod::Spec.new do |s|
s.name = 'SLShareSDK'
s.version = '0.1.0'
s.summary = 'Intergation'
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
TODO: SLShare...
DESC
s.homepage = 'http://gitlaBalaBala...'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Melody' => 'BalaBala.com' }
s.source = { :git => 'http://gitlab.balabala...../SLShareSDK.git', :tag => s.version.to_s }
s.ios.deployment_target = '7.0'
s.source_files = 'SLShareSDK/Classes/**/*'
s.ios.vendored_libraries = 'SLShareSDK/Assets/*.a'
s.ios.vendored_frameworks = 'SLShareSDK/Assets/TencentOpenAPI.framework'
s.resource_bundles = {
'SLShareSDK' => ['SLShareSDK/Assets/*.bundle']
}
s.frameworks = 'UIKit', 'SystemConfiguration','Security','CoreTelephony','ImageIO'
s.libraries = 'sqlite3','z.1.2.8','c++.1'
s.dependency 'AFNetworking', '~> 2.6.3'
end
Here is the directory structure :
├── SLShareSDK
│   ├── Assets
│   │   ├── TencentOpenAPI.framework
│   │   │   ├── Headers
│   │   │   ├── Resources
│   │   │   └── TencentOpenAPI
│   │   ├── libWeChatSDK.a
│   │   └── libWeiboSDK.a
│   └── Classes
│   └── SLShareSDK
│   ├── AFHTTPRequestOperationManager+JXExtentsion.h
│   ├── AFHTTPRequestOperationManager+JXExtentsion.m
│   ├── SLShare.h
│   ├── SLShare.m
│   ├── SLShareAuthorizeObject.h
│   ├── SLShareAuthorizeObject.m
│   ├── SLShareConfiguration.plist
│   ├── SLShareConstant.h
│   ├── SLShareConstant.m
│   ├── SLShareContentObject.h
│   ├── SLShareContentObject.m
│   ├── SLShareContentObjectTranslater.h
│   ├── SLShareContentObjectTranslater.m
│   ├── SLShareQQ.h
│   ├── SLShareQQ.m
│   ├── SLShareSina.h
│   ├── SLShareSina.m
│   ├── SLShareWeChat.h
│   ├── SLShareWeChat.m
│   ├── WBHttpRequest+WeiboGame.h
│   ├── WBHttpRequest+WeiboShare.h
│   ├── WBHttpRequest+WeiboToken.h
│   ├── WBHttpRequest+WeiboUser.h
│   ├── WBHttpRequest.h
│   ├── WBSDKBasicButton.h
│   ├── WBSDKCommentButton.h
│   ├── WBSDKRelationshipButton.h
│   ├── WXApi.h
│   ├── WXApiObject.h
│   ├── WechatAuthSDK.h
│   ├── WeiboSDK+Statistics.h
│   ├── WeiboSDK.h
│   └── WeiboUser.h
├── SLShareSDK.podspec
Q1.:
In my Opinion,
The Program Use the TencentOpenAPI.framework and I aleady set s.ios.vendored_frameworks = 'SLShareSDK/Assets/TencentOpenAPI.framework' make sure the code path currect.
And I Use pod lib lint --use-libraries --verbose Check Out the Specrepo
But it show error make me crazed.But the way,The Same code I Use xcode run without problems.
So,This is my situation, thank you for your attention and help, if you have some suggestion please help me !!!
I also got this error when i try to link it agains third party framework, i found no solution but have to take out the header files alone out to let the lib build without linking, after that it work, would like to know a better solution though, see this for more info, also contain a fix by changing the validator.rb
I think I have found out the problem, as the error mentioned in the latest TencentOpenAPI.framework does not support i836CPU, so I try to use the old API to run, it's working!!!. But I do not know how to change pod lib lint does not run the i836 compiler...

can not create yeoman project on my mac running OS X Yosemite 10.11.2 (angular-generator)

can not create yeoman project on my mac running OS X Yosemite 10.11.2 (angular-generator)
npm WARN EPEERINVALID gulp-karma#0.0.4 requires a peer of karma#>=0.10
<=0.13 but none was installed.
[10:29:09] Using gulpfile ~/Workspace/yeoman/mytodo/gulpfile.js
[10:29:09] Task 'wiredep' is not in your gulpfile
[10:29:09] Please check the documentation for proper gulpfile formatting
? Overwrite package.json? overwrite this and all others
force package.json
create .travis.yml
mytodo# /Users/alan/Workspace/yeoman/mytodo
├── UNMET PEER DEPENDENCY grunt#0.4.x
├─┬ grunt-karma#0.12.1
│ └── lodash#3.10.1
├─┬ gulp-imagemin#2.4.0
│ └─┬ imagemin#4.0.0
│ └─┬ imagemin-svgo#4.2.0
│ └─┬ svgo#0.6.1
│ └─┬ js-yaml#3.4.6
│ └─┬ argparse#1.0.3
│ └── lodash#3.10.1
├─┬ gulp-jshint#1.12.0
│ └── lodash#3.10.1
├─┬ gulp-sass#2.1.1
│ └─┬ node-sass#3.4.2
│ └─┬ sass-graph#2.0.1
│ └── lodash#3.10.1
├── UNMET PEER DEPENDENCY jasmine-core#*
├── UNMET PEER DEPENDENCY karma#^0.13.0 || >= 0.14.0-rc.0
├── karma-jasmine#0.3.6
├─┬ karma-phantomjs-launcher#0.2.1
│ └── lodash#3.10.1
└── UNMET PEER DEPENDENCY phantomjs#>=1.9
npm WARN EPEERINVALID gulp-karma#0.0.4 requires a peer of karma#>=0.10 <=0.13 but none was installed.
npm WARN EPEERINVALID karma-jasmine#0.3.6 requires a peer of jasmine-core#* but none was installed.
npm WARN EPEERINVALID grunt-karma#0.12.1 requires a peer of grunt#0.4.x but none was installed.
npm WARN EPEERINVALID grunt-karma#0.12.1 requires a peer of karma#^0.13.0 || >= 0.14.0-rc.0 but none was installed.
npm WARN EPEERINVALID karma-phantomjs-launcher#0.2.1 requires a peer of karma#>=0.9 but none was installed.
npm WARN EPEERINVALID karma-phantomjs-launcher#0.2.1 requires a peer of phantomjs#>=1.9 but none was installed.
use yeoman angular-generator,when I run 'gulp serve',the console shows:
Uncaught ReferenceError: angular is not defined!
I ran into problems when installing Yeoman on my mac as well. For me updating node/npm fixed the issues.

How to control version of zip dependencies?

I'm doing a Proof of Concept with Bower, and trying to create packages without using Git (this is a requirement). I have two packages:
core - main package
datetime - depends on core
In bower.json we declare the version of the package, why the install create an e-tag instead?
Example of install command:
bower install http://path.to.package/core-0.0.1.zip
If I run bower list I can see it (ommited some other dependencies):
├── angular#1.3.12 (1.4.0-build.3831+sha.056a317 available)
├─┬ angular-animate#1.3.12 (1.4.0-build.3831+sha.056a317 available)
│ └── angular#1.3.12 (latest is 1.4.0-build.3831+sha.056a317)
├─┬ angular-cookies#1.3.12 (1.4.0-build.3831+sha.056a317 available)
│ └── angular#1.3.12
├─┬ angular-mocks#1.3.12 (1.3.14-build.49+sha.6b7625a available, latest is 1.4.0
-build.3831+sha.056a317)
│ └── angular#1.3.12
├─┬ angular-resource#1.3.12 (1.4.0-build.3831+sha.056a317 available)
│ └── angular#1.3.12
├─┬ angular-route#1.3.12 (1.4.0-build.3831+sha.056a317 available)
│ └── angular#1.3.12
├─┬ angular-sanitize#1.3.12 (1.4.0-build.3831+sha.056a317 available)
│ └── angular#1.3.12
├─┬ angular-scenario#1.3.12 (1.3.14-build.49+sha.6b7625a available, latest is 1.
4.0-build.3831+sha.056a317)
│ └── angular#1.3.12
├─┬ angular-touch#1.3.12 (1.4.0-build.3831+sha.056a317 available)
│ └── angular#1.3.12
├─┬ bootstrap-sass-official#3.3.3
│ └── jquery#2.0.3 (2.1.3 available)
├── es5-shim#4.1.0
├── json3#3.3.2
├─┬ core#e-tag:53d7d65924
│ ├─┬ angular-strap#0.7.4 (latest is 2.1.6)
│ │ ├── bootstrap#2.3.2 (3.3.2 available)
│ │ ├─┬ bootstrap-datepicker#1.3.1
│ │ │ ├── bootstrap#2.3.2 incompatible with >=3.0 <4.0 (3.3.2 available)
│ │ │ └── jquery#2.0.3 (2.1.3 available)
│ │ ├─┬ bootstrap-select#1.6.3 (2.0.0-beta1 available)
│ │ │ └── jquery#2.0.3 (2.1.3 available)
│ │ ├─┬ bootstrap-timepicker#0.2.6
│ │ │ ├── autotype#e-tag:4fc86fb68
│ │ │ ├── bootstrap#2.3.2 (latest is 3.3.2)
│ │ │ └── jquery#2.0.3 (2.1.3 available)
│ │ └── jquery#2.0.3 (2.1.3 available)
└── datetime#e-tag:4c585cbc3e extraneous
How can I install zip packages and control the dependencies with version?
Bower is currently ignoring the version property specified in bower.json, for more info see the bower.json specification.
When resolving a package from a URL and an ETag header is present in the response, Bower will store the value of this header in the package metadata. When checking if a new version of the package is available, Bower will use the cache ETag (by sending a If-None-Match header).
Notice that Bower's support for working with URL target is limited and is not a drop-in replacement for working with Git. For further details take a look at UrlResolver.js.

Cordova 3.1.0 : Command Line interface not working

Cordova 3.1.0 : Command Line interface not working . I installed node.js and used th following command
$ sudo npm install -g cordova
after installation am getting following output :
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
cordova#3.1.0-0.2.0 /usr/local/lib/node_modules/cordova
├── ncallbacks#1.0.0
├── semver#1.1.0
├── colors#0.6.2
├── open#0.0.3
├── mime#1.2.11
├── q#0.9.7
├── shelljs#0.1.2
├── follow-redirects#0.0.3 (underscore#1.5.2)
├── optimist#0.6.0 (wordwrap#0.0.2, minimist#0.0.5)
├── xcode#0.5.1 (node-uuid#1.3.3, pegjs#0.6.2)
├── glob#3.2.6 (inherits#2.0.1, minimatch#0.2.12)
├── tar#0.1.18 (inherits#2.0.1, block-stream#0.0.7, fstream#0.1.24)
├── elementtree#0.1.5 (sax#0.3.5)
├── prompt#0.2.7 (revalidator#0.1.5, pkginfo#0.3.0, read#1.0.5, utile#0.1.7, winston#0.6.2)
├── express#3.0.0 (methods#0.0.1, fresh#0.1.0, range-parser#0.0.4, debug#0.7.3, cookie#0.0.4, crc#0.2.0, commander#0.6.1, mkdirp#0.3.3, send#0.1.0, connect#2.6.0)
├── request#2.22.0 (json-stringify-safe#4.0.0, aws-sign#0.3.0, forever-agent#0.5.0, qs#0.6.5, tunnel-agent#0.3.0, oauth-sign#0.3.0, cookie-jar#0.3.0, node-uuid#1.4.1, http-signature#0.10.0, hawk#0.13.1, form-data#0.0.8)
├── npm#1.3.13
├── plist#0.4.3 (xmlbuilder#0.4.2, xmldom#0.1.16)
├── ripple-emulator#0.9.18 (connect-xcors#0.5.2, colors#0.6.0-1, accounting#0.3.2, request#2.12.0, moment#1.7.2, express#3.1.0)
└── plugman#0.14.0 (ncallbacks#1.1.0, osenv#0.0.3, bplist-parser#0.0.4, semver#2.0.11, underscore#1.4.4, nopt#1.0.10, dep-graph#1.1.0, xcode#0.6.1, rc#0.3.0, tar.gz#0.1.1, npm#1.3.4)
Not able to create add platform or create a project .
while using this command
$ cordova create hello com.example.hello HelloWorld
am getting the following error.
-bash: cordova: command not found
am using MAC OS
Did your PATH system variable include /usr/local/bin/?
You need to add the NPM directory into your PATH, so that you can run "cordova" from anywhere and it will get picked up.
For example, I had to add
;C:\Users\MBillau\AppData\Roaming\npm
which is where my npm folder is.

Resources