由于 Jcenter 即将关闭,我\xe2\x80\x99m 尝试将我的库迁移到 Maven Central。我进行了很多搜索以找到任何可用的脚本,但没有运气。有官方文档,但这就像一个笑话,只是告诉将maven-publish插件添加到 gradle 脚本中,瞧,\xe2\x80\x99s 它。
目前我收到错误:
\nCaused by: org.gradle.api.publish.maven.InvalidMavenPublicationException: Invalid publication \'js\': multiple artifacts with the identical extension and classifier (\'jar\', \'sources\').\nRun Code Online (Sandbox Code Playgroud)\n我的脚本如下所示:
\nplugins {\n id("kotlin-multiplatform")\n id("org.jetbrains.dokka") version "1.4.0-rc"\n `maven-publish`\n signing\n}\n\nkotlin {\n sourceSets {\n jvm()\n js() {\n nodejs()\n browser()\n }\n linuxX64()\n linuxArm64()\n mingwX64()\n macosX64()\n iosArm64()\n iosX64()\n\n val commonMain by getting {\n dependencies {\n }\n }\n val commonTest by getting {\n dependencies {\n implementation(kotlin("test-common"))\n implementation(kotlin("test-annotations-common"))\n }\n }\n\n val jsMain …Run Code Online (Sandbox Code Playgroud) @SuppressWarnings("WeakerAccess")kotlin 中有替代方案吗?
我尝试过@Suppress("WeakerAccess")但没有运气。在开发库时看到“ Function xxx might be private ”是非常烦人的。
当我尝试使用意图机制共享文本并选择 WhatsApp 时,它说:
无法发送空消息
我在这里阅读了有关 Android 集成的官方文档:https : //faq.whatsapp.com/en/android/28000012
我的代码:
public void shareText(String label, CharSequence title, CharSequence body) {
final Intent intent = new Intent(Intent.ACTION_SEND);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, title.toString());
intent.putExtra(Intent.EXTRA_TEXT, TextUtils.concat(title, body));
final Intent chooser = Intent.createChooser(intent, label);
chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (chooser.resolveActivity(mContext.getPackageManager()) != null) {
mContext.startActivity(chooser);
}
}
Run Code Online (Sandbox Code Playgroud)
难道我做错了什么?或者是WhatsApp Messenger的错误?
PS 参数title并且body在我的情况下不是空的。