源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

sweet alert dialog 在android studio应用问题说明详解

  • 时间:2022-04-05 08:08 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:sweet alert dialog 在android studio应用问题说明详解
看到这个sweet-alert-dialog很亲切,因为前端开发本人用的提示就是这个js插件,java牛人很厉害,直接弄成一个java包插件,Good! [b]下面记录如何引用到工程,并使用:[/b] sweet-alert-dialog插件可以直接到github上下载 地址:[url=https://github.com/pedant/sweet-alert-dialog]https://github.com/pedant/sweet-alert-dialog[/url] 或者直接到发布好的页面下载: [url=https://github.com/pedant/sweet-alert-dialog/releases]https://github.com/pedant/sweet-alert-dialog/releases [/url] 我下载的是:sweet-alert-dialog-1.1版本zip包 将下载sweet-alert-dialog-1.1包解压出来,再你的app项目中,打开 File -> New -> Import Module 选择到刚才解压的文件夹 [img]http://files.jb51.net/file_images/article/201609/20160921110538155.jpg[/img] [img]http://files.jb51.net/file_images/article/201609/20160921110538156.jpg[/img] [img]http://files.jb51.net/file_images/article/201609/20160921110539157.jpg[/img] [b]报错:[/b] Error:Dependency Myalert:sweetalertdialog:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: D:\AndroidStudioProjects\TEST\Myalert\sweetalertdialog\build\outputs\apk\sweetalertdialog-release-unsigned.apk 可以先Build一下sweet-alert-dialog工程。 另外你的工程Gradle Scripts目录下的bulid.gradle (Module:app)下
dependencies { 
compile fileTree(include: [‘*.jar'], dir: ‘libs') 
testCompile ‘junit:junit:4.12' 
compile ‘com.android.support:appcompat-v7:24.1.1' 
compile ‘cn.pedant.sweetalert:library:1.3' 
}
引入:compile ‘cn.pedant.sweetalert:library:1.3' [b]Build app出现新的错误信息:[/b] Error:Execution failed for task ‘:app:processDebugManifest'. Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:7:9-43 is also present at [com.pnikosis:materialish-progress:1.0] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher). Suggestion: add ‘tools:replace=”android:icon”' to element at AndroidManifest.xml:5:5-18:19 to override. [b]解决方法:[/b] 修改AndroidManifest.xml: 在manifest添加 xmlns:tools=”http://schemas.android.com/tools” 在application添加 tools:replace=”android:icon,android:theme,android:allowBackup,android:label,android:supportsRtl” 将在application中所用到的全部android:都在上面tools:replace=添加进去,逗号分隔。 如下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="cn.cgrs.myalert">
<application
tools:replace="android:allowBackup,android:icon,android:label,android:supportsRtl,android:theme"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
到此sweet-alert-dialog已完成配置,可以开始随意使用了…. 以上所述是小编给大家介绍的sweet alert dialog 在android studio应用问题说明详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对编程素材网网站的支持!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部