- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的代码
这是我的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
flavorDimensions"mode"
defaultConfig {
applicationId "com.research.home"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
productFlavors{
sandbox{
applicationId "com.research.home"
resValue "string", "app_name", "Rumah Riset"
buildConfigField "string", "MERCHANT_BASE_URL", "\"My Url Server/\""
buildConfigField "string", "MERCHANT_CLIENT_KEY", "My client key kode"
}
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
configurations {
compile.exclude group: "junit", module: "junit"
}
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.20"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'org.testng:testng:6.9.6'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.karumi:dexter:6.2.1'
implementation 'com.google.firebase:firebase-core:18.0.0'
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation 'com.google.firebase:firebase-auth:20.0.1'
implementation 'com.google.firebase:firebase-storage:19.2.0'
implementation 'com.google.firebase:firebase-database:19.5.1'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.firebase:firebase-messaging:21.0.0'
//picasso
implementation 'com.squareup.picasso:picasso:2.5.2'
//circle image view library
implementation 'de.hdodenhof:circleimageview:3.1.0'
//glide library
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
implementation 'com.google.android.exoplayer:exoplayer:2.10.8'
implementation 'com.google.android.exoplayer:exoplayer-core:2.10.8'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.10.8'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.10.8'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.10.8'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.10.8'
implementation 'com.firebaseui:firebase-ui-database:6.2.0'
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
//implementation 'com.github.naya-aastra:SkewPdfView:1.1'
implementation 'com.github.kk121:File-Loader:1.2'
//Neorophism
//implementation 'com.github.4inodev:Neomorphic-FrameLayout-Android:1.03'
//Tooltip
implementation 'com.github.florent37:viewtooltip:1.2.2'
//midtrans.com
// For using the Midtrans Sandbox
implementation 'com.midtrans:uikit:1.24.1-SANDBOX' // change the number to the latest version
// For using the Midtrans Production
// implementation 'com.midtrans:uikit:1.24.1' // change the number to the latest version
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
我该如何修复这个错误代码
这个错误代码
> Task :app:mergeSandboxDebugResources FAILED
AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"string/app_name","path":"C:\\Users\\ASUS\\Downloads\\Documents\\android\\BuildTwo\\app\\src\\main\\res\\values\\strings.xml"}},{"file":{"description":"string/app_name","path":"C:\\Users\\ASUS\\Downloads\\Documents\\android\\BuildTwo\\app\\build\\generated\\res\\resValues\\sandbox\\debug\\values\\gradleResValues.xml"}}],"tool":"Resource and asset merger"}
Execution failed for task ':app:mergeSandboxDebugResources'.
> [string/app_name] C:\Users\ASUS\Downloads\Documents\android\BuildTwo\app\src\main\res\values\strings.xml [string/app_name] C:\Users\ASUS\Downloads\Documents\android\BuildTwo\app\build\generated\res\resValues\sandbox\debug\values\gradleResValues.xml:
Error: Duplicate resources
当我构建代码时,它会显示这样的错误,
这是我的string.xml
<resources>
<string name="app_name">Research Home</string>
<string name="already_have_account">Already Have Account ?</string>
<string name="sign_in">Sign In</string>
<string name="sign_up">Sign Up</string>
<string name="full_name">Full Name</string>
<string name="email">Email</string>
<string name="password">Password</string>
<string name="confirmation_password">Confirmation Password</string>
<string name="choose_your_class">Choose Your Class</string>
<string name="menu_home" translatable="false">Home</string>
<string name="menu_chat" translatable="false">Chat</string>
<string name="menu_profile" translatable="false">Profile</string>
<string name="menu_payment" translatable="false">Payment</string>
<string name="welcome_admin">Welcome, Admin</string>
<string name="no_file_selected">No File Selected</string>
<string name="pls_select_a_podcast">Please Select a Podcast</string>
<string name="select_podcast">Select Podcast</string>
<string name="upload">Upload</string>
<string name="select_video">Select Video</string>
<string name="please_select_a_video">Please Select a Video</string>
<string name="question">Question</string>
<string name="write_a_question" translatable="false">Write a Question</string>
<string name="answer">Answer</string>
<string name="answerAlpha" translatable="false">A</string>
<string name="writeanswer" translatable="false">Write a Answer</string>
<string name="answerBravo" translatable="false">B</string>
<string name="answerCharlie" translatable="false">C</string>
<string name="answerDelta" translatable="false">D</string>
<string name="upload_quiz">Upload Quiz</string>
<string name="edit_quiz">Edit Quiz</string>
<string name="classess">Class</string>
<string name="directss">Direct</string>
<string name="pay">Pay</string>
<string name="edit">Edit</string>
<string name="delete">Delete</string>
<string name="business_management" translatable="false">Business Management</string>
<string name="enterpreneur" translatable="false">Enterpreneur</string>
<string name="enrichment" translatable="false">Enrichment</string>
<string name="click_to_play">Click to Play</string>
<string-array name="Podcast_Path">
<item>Select Podcast List</item>
<item>Podcast1</item>
<item>Podcast2</item>
<item>Podcast3</item>
</string-array>
<string-array name="Podcast_Edit_Path">
<item>Podcast1</item>
<item>Podcast2</item>
<item>Podcast3</item>
</string-array>
<string-array name="Video_Path">
<item>Select Video Path</item>
<item>Business Management Basic</item>
<item>Business Management Middle Science</item>
<item>Business Managemen Middle Social Science</item>
<item>Business Management Advance Science</item>
<item>Business Management Advance Social Science</item>
<!-- Enterpreneur -->
<item>Enterpreneur Basic</item>
<item>Enterpreneur Middle Science</item>
<item>Enterpreneur Middle Social Science</item>
<item>Enterpreneur Advance Science</item>
<item>Enterpreneur Advance Social Science</item>
<!-- Enrichment -->
<item>Enrichment Basic</item>
<item>Enrichment Middle Science</item>
<item>Enrichment Middle Social Science</item>
<item>Enrichment Advance Science</item>
<item>Enrichment Advance Social Science</item>
</string-array>
<string-array name="Quiz_Path">
<item>Select Quiz Path</item>
<item>Business Management Quiz</item>
<item>Enterpreneur Quiz</item>
<item>Enrichment Quiz</item>
<item>Video Path 3</item>
</string-array>
<string-array name="Quiz_Path_Edit">
<item>Business Management Quiz</item>
<item>Enterpreneur Quiz</item>
<item>Enrichment Quiz</item>
<item>Video Path 3</item>
</string-array>
<string-array name="Quiz_Num">
<item>Select Quiz Number</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
</string-array>
<string-array name="Quiz_Theory">
<item>Select Quiz Theory</item>
<item>Quiz Theory 1</item>
<item>Quiz Theory 2</item>
<item>Quiz Theory 3</item>
<item>Quiz Theory 4</item>
<item>Quiz Theory 5</item>
<item>Quiz Theory 6</item>
</string-array>
<string-array name="Video_Theory">
<item>Select Video Theory</item>
<item>Theory 1</item>
<item>Theory 2</item>
<item>Theory 3</item>
<item>Theory 4</item>
<item>Theory 5</item>
<item>Theory 6</item>
<item>Theory 7</item>
<item>Theory 8</item>
<item>Theory 9</item>
<item>Theory 10</item>
<item>Theory 11</item>
<item>Theory 12</item>
</string-array>
<string-array name="Video_Edit_Path">
<item>Business Management Basic</item>
<item>Business Management Middle Science</item>
<item>Business Managemen Middle Social Science</item>
<item>Business Management Advance Science</item>
<item>Business Management Advance Social Science</item>
<!-- Enterpreneur -->
<item>Enterpreneur Basic</item>
<item>Enterpreneur Middle Science</item>
<item>Enterpreneur Middle Social Science</item>
<item>Enterpreneur Advance Science</item>
<item>Enterpreneur Advance Social Science</item>
<!-- Enrichment -->
<item>Enrichment Basic</item>
<item>Enrichment Middle Science</item>
<item>Enrichment Middle Social Science</item>
<item>Enrichment Advance Science</item>
<item>Enrichment Advance Social Science</item>
</string-array>
<string-array name="Video_Edit_Theory">
<item>Theory 1</item>
<item>Theory 2</item>
<item>Theory 3</item>
<item>Theory 4</item>
<item>Theory 5</item>
<item>Theory 6</item>
<item>Theory 7</item>
<item>Theory 8</item>
<item>Theory 9</item>
<item>Theory 10</item>
<item>Theory 11</item>
<item>Theory 12</item>
</string-array>
<string-array name="Ebook_Path">
<item>Select Ebook Path</item>
<item>Business Management Basic</item>
<item>Business Management Middle Science</item>
<item>Business Managemen Middle Social Science</item>
<item>Business Management Advance Science</item>
<item>Business Management Advance Social Science</item>
<!-- Enterpreneur -->
<item>Enterpreneur Basic</item>
<item>Enterpreneur Middle Science</item>
<item>Enterpreneur Middle Social Science</item>
<item>Enterpreneur Advance Science</item>
<item>Enterpreneur Advance Social Science</item>
<!-- Enrichment -->
<item>Enrichment Basic</item>
<item>Enrichment Middle Science</item>
<item>Enrichment Middle Social Science</item>
<item>Enrichment Advance Science</item>
<item>Enrichment Advance Social Science</item>
</string-array>
<string-array name="Ebook_Theory">
<item>Select Ebook Theory</item>
<item>Theory 1</item>
<item>Theory 2</item>
<item>Theory 3</item>
<item>Theory 4</item>
<item>Theory 5</item>
<item>Theory 6</item>
<item>Theory 7</item>
<item>Theory 8</item>
<item>Theory 9</item>
<item>Theory 10</item>
<item>Theory 11</item>
<item>Theory 12</item>
</string-array>
<string name="theory">Theory</string>
<string name="press_back_again">Press back again to Exit</string>
<string name="email_is_required">Email can\'t be empty</string>
<string name="password_is_required">Password can\'t be empty</string>
<string name="fname_is_required">Name can\'t be empty</string>
<string name="password_must_same">Confirm your password</string>
<string name="password_character">Password must have 8 character or more</string>
<string name="lang">English</string>
<string name="scores">Scores</string>
<string name="forgot_password">Forgot password?</string>
<string name="basicexplain">Recommended for Beginner (the Basics of Scientists ) </string>
<string name="middleexplain">Recommended for Middle ( the Middless of Scientists )</string>
<string name="advanceexplain">Recommended for Advance ( the Advances of Scientists )</string>
<string name="cancel">Cancel</string>
<string name="change">Change</string>
</resources>
错误立即指向我创建的字符串,但字符串中没有错误或重复。
我试过在build.gradle中更改app_name名称和应用程序id,但它仍然显示重复资源
请帮我修复这段代码
谢谢你:)
最佳答案
是的,有重复的字符串资源名为app_name:
<resources>
<string name="app_name">Research Home</string> //here
sandbox{
applicationId "com.research.home"
resValue "string", "app_name", "Rumah Riset" //and here
要解决此问题,您可以在 defaultConfig 中将 app_name
声明为空:
defaultConfig {
resValue "string", "app_name", ""
}
关于java - 如何修复重复资源错误android studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65193130/
有人告诉我,如果我只有一个“东西”,比如家(不是多个家),我应该在 routes.rb 中使用资源 :home,而不是资源 :home。但是当我查看路由时,POST 函数似乎想要 home#creat
Activity 开始。这些代码框架顺利通过。 // Initialize array adapters. One for already paired devices and //
资源 search-hadoop.com search-hadoop.com索引所有邮件列表,非常适合历史搜索。当你遇到问题时首先在这里搜索,因为很可能有人已经遇到了你的问题。 邮件列表 在A
我是 WPF 的新手,正在努力使用位于单独程序集中的样式。这就是我正在做的:- 我有一个带有\Themes 文件夹的类库项目,其中包含一个“generic.xaml”,它合并了\Themes 内的子文
我正在编写一个使用虚拟树状文件结构的插件。基本上它就像一个包含文件的标准文件系统,区别在于这些文件实际上并不存在于文件系统中的特定位置,而只是 java 对象。 这些当前由使用 SettingProv
如果我在 XAML 中使用以下内容,我会收到错误消息: 错
我正在使用 laravel 资源来获取 api 的数据: return [ 'id' => $this->id, 'unread' =>
我有以下 pom.xml: 4.0.0 mycompany resource-fail 0.0.1-SNAPSHOT BazBat
许多GDI +类都实现IDisposable,但是我不确定何时应该调用Dispose。对于使用new或静态方法(例如Graphics.CreateGraphics)创建的实例来说,这很明显。但是,由属
我正在构建一组 RESTful 资源,其工作方式如下:(我将使用“people”作为示例): 获取/people/{key} - 返回一个人对象 (JSON) GET/people?first_nam
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我有一个使用 $resource 的简单 Controller : var Regions = $resource('mocks/regions.json'); $scope.regions =
在 Azure 门户中,如何查看不同资源之间的依赖关系。我特别想查看哪些资源正在使用我要删除的存储。 最佳答案 您可以使用应用程序洞察应用程序 map 来执行此操作: 您还可以打开存储帐户的日志记录:
我正在使用 ionic 生成资源(图标和启动画面)。我正在使用 ionic v2.1.0 和 cordova v6.4.0。 到目前为止我一直在使用(它在以前的版本中工作): cordova plat
是否可以使用 Assets 包含子文件夹中的文件? 示例:[base_url]/assets/css/pepper-grinder/jquery-ui-1.8.11.custom.min.css 最佳
我正在阅读一些尝试教授 Android 开发的书。在书中,作者概述了 res/下的一些目录。他提到 res/menu 包含基于 XML 的菜单规范。他还提到了保存“通用文件”的 res/raw。当我创
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 9 年前。 Improv
我在服务器上使用 express-resource。在我的 AngularJS Controller 中: var User = $resource('/services/users/:use
因此,每当我运行我的应用程序时,它都会立即崩溃并给出以下错误: No package identifier when getting value for resource number 0x00000
对于我正在创建的(网络)应用程序,我需要使用基本身份验证在我的 UIWebView 中加载页面。 现在设置我使用的授权 header : NSString *result = [NSString st
我是一名优秀的程序员,十分优秀!