AS打包apk及常见错误解决办法Error:(4) Error: "ssdk_instapager_login_html" is not translated in "en" (English)

来源:互联网 发布:三星4300清零软件 编辑:程序博客网 时间:2024/05/22 07:57

Error:(4) Error: "ssdk_instapager_login_html" is not translated in "en" (English) [MissingTranslation]


很明显错误是资源文件Values文件夹下的strings文件没能翻译成英文,而我们也不需要这种翻译我们该怎么办呢?

修改资源文件添加

 translatable="false"
属性当然可以,但是这样加起来很多不好弄,
[html] view plain copy
  1. <string name="app_name" translatable="false">你好</string>  

为了一键解决这个问题,我们可以在要打包的module的buil.gradle文件中加标签。就能快速帮你解决。

[html] view plain copy
  1. lintOptions{  
  2.     checkReleaseBuilds false  
  3.     abortOnError false  
  4. }  

checkReleaseBuilds就是在打包Release版本的时候进行检测,这里就直接关掉了,也可以打开,这样报错还会显示出来。关键的就是abortOnError一定要设为false,这样即使有报错也不会停止打包了。

把该标签加到,对应的android标签中如下:

[html] view plain copy
  1. apply plugin: 'com.android.application'  
  2.   
  3. android {  
  4.     compileSdkVersion 25  
  5.     buildToolsVersion "25.0.2"  
  6.     defaultConfig {  
  7.         applicationId "cn.banwxf.shoppingmall"  
  8.         minSdkVersion 19  
  9.         targetSdkVersion 25  
  10.         versionCode 1  
  11.         versionName "1.0"  
  12.         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"  
  13.   
  14.         ndk {  
  15.             abiFilters "armeabi-v7a", "x86"  
  16.         }  
  17.     }  
  18.     lintOptions{  
  19.         checkReleaseBuilds false  
  20.         abortOnError false  
  21.     }  
  22.     buildTypes {  
  23.         release {  
  24.             minifyEnabled false  
  25.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'  
  26.         }  
  27.     }  
  28.     sourceSets {  
  29.         main {  
  30.             jniLibs.srcDirs = ['libs']  
  31.         }  
  32.     }  
  33. }  
  34.   
  35. dependencies {  
  36.     compile fileTree(include: ['*.jar'], dir: 'libs')  
  37.     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {  
  38.         exclude group: 'com.android.support', module: 'support-annotations'  
  39.     })  
  40.     compile project(':IMKit')  
  41.     compile 'com.jakewharton:butterknife:5.1.1'  
  42.     compile 'com.android.support:support-v4:25.1.1'  
  43.     compile 'com.squareup.retrofit2:retrofit:2.0.2'  
  44.     compile 'com.squareup.retrofit2:converter-gson:2.0.2'  
  45.     compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'  
  46.     compile 'com.android.support:appcompat-v7:25.1.1'  
  47.     compile files('libs/fuqianla/fuqianla_support.jar')  
  48.     compile files('libs/fuqianla/fuqianla2_6_0.jar')  
  49.     compile files('libs/alipay/alipaySDK.jar')  
  50.     compile files('libs/wxpay/libammsdk.jar')  
  51.     compile files('libs/unionpay/UPPayPluginExPro.jar')  
  52.     compile files('libs/unionpay/UPPayAssistEx.jar')  
  53.     compile files('libs/MiPush_SDK_Client_3_2_2.jar')  
  54. }  

值得注意的是标签位置,1、要打包的module下的build.gradle文件,2、android标签是父标签

阅读全文
0 0
原创粉丝点击