Facebook strings has no default translation

匿名 (未验证) 提交于 2019-12-03 08:33:39

问题:

I got this error today trying to run an app with Facebook SDK attached into it.

Warning:string 'com_facebook_smart_login_confirmation_continue_as_f1gender' has no default translation. Warning:string 'com_facebook_loginview_log_out_action_f1gender' has no default translation. Warning:string 'com_facebook_loginview_log_in_button_continue_f1gender' has no default translation. Warning:string 'com_facebook_smart_login_confirmation_continue_as_m2gender' has no default translation. Warning:string 'com_facebook_loginview_log_out_button_m2gender' has no default translation. Warning:string 'com_facebook_loginview_log_out_action_m2gender' has no default translation. Warning:string 'com_facebook_share_button_text_m2gender' has no default translation. Warning:string 'com_facebook_loginview_logged_in_as_f1gender' has no default translation. Warning:string 'com_facebook_send_button_text_m2gender' has no default translation. Warning:string 'com_facebook_smart_login_confirmation_cancel_m2gender' has no default translation. Warning:string 'com_facebook_loginview_logged_in_using_facebook_m2gender' has no default translation. Warning:string 'com_facebook_loginview_log_out_button_f1gender' has no default translation. Warning:string 'com_facebook_send_button_text_f1gender' has no default translation. Warning:string 'com_facebook_loginview_logged_in_as_m2gender' has no default translation. Warning:string 'com_facebook_smart_login_confirmation_cancel_f1gender' has no default translation. Warning:string 'com_facebook_loginview_logged_in_using_facebook_f1gender' has no default translation. Warning:string 'com_facebook_share_button_text_f1gender' has no default translation. Warning:string 'com_facebook_loginview_log_in_button_continue_m2gender' has no default translation. Warning:string 'com_facebook_smart_login_confirmation_title_f1gender' has no default translation. Warning:string 'com_facebook_smart_login_confirmation_title_m2gender' has no default translation. Warning:string 'com_facebook_tooltip_default_f1gender' has no default translation. Warning:string 'com_facebook_tooltip_default_m2gender' has no default translation. Error:Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes Error:1 error; aborting Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process Information:BUILD FAILED 

I'm trying to figure out why but I didn't try to ask for another string language than English. In the case of need, this is my app Gradle:

apply plugin: 'com.android.application'  android {     compileSdkVersion 25     buildToolsVersion "25.0.2"     defaultConfig {         applicationId ".chillout"         minSdkVersion 15         targetSdkVersion 25         versionCode 1         versionName "1.0"         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"     }     buildTypes {         release {             minifyEnabled false             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     compile fileTree(dir: 'libs', include: ['*.jar'])     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {         exclude group: 'com.android.support', module: 'support-annotations'     })     compile 'com.android.support:appcompat-v7:25.1.1'     compile 'com.android.support:design:25.3.1'     compile 'com.github.bumptech.glide:glide:3.7.0'     compile 'com.google.firebase:firebase-database:10.0.0'     compile 'com.google.firebase:firebase-storage:10.0.0'     compile 'com.google.firebase:firebase-messaging:10.0.0'     compile 'com.facebook.android:facebook-android-sdk:[4,5)'     compile 'com.firebaseui:firebase-ui-database:1.2.0'     compile 'com.android.support:cardview-v7:25.3.0'     compile 'com.android.support.constraint:constraint-layout:1.0.2'     testCompile 'junit:junit:4.12' } apply plugin: 'com.google.gms.google-services' 

And this is my project Gradle.

// Top-level build file where you can add configuration options common to all sub-projects/modules.  buildscript {     repositories {         jcenter()         mavenCentral()     }     dependencies {         classpath 'com.android.tools.build:gradle:2.3.3'         classpath 'com.google.gms:google-services:3.0.0'          // NOTE: Do not place your application dependencies here; they belong         // in the individual module build.gradle files     } }  allprojects {     repositories {         jcenter {         }     } }  task clean(type: Delete) {     delete rootProject.buildDir } 

Thank you!

回答1:

(As of July 11, 2017)

Roll back to the previous version, which is 4.23.0, seems to be working fine. I.e.

    compile 'com.facebook.android:facebook-android-sdk:4.23.+' 

The latest release 4.24.0 seems to be problematic in many ways on both Android and iOS.



回答2:

I had the same com_facebook warnings while building my app, but without the errors. So my guess is that the warnings and the errors are not related to each other.

In any case, I got rid of the com_facebook warnings by adding a file res/values/facebook-strings.xml containing the following:

<?xml version="1.0" encoding="utf-8"?> <resources>   <string name="com_facebook_loginview_log_in_button_continue_f1gender">Continue</string>   <string name="com_facebook_loginview_log_in_button_continue_m2gender">Continuee</string>   <string name="com_facebook_loginview_log_out_action_f1gender">Log out</string>   <string name="com_facebook_loginview_log_out_action_m2gender">Log out</string>   <string name="com_facebook_loginview_log_out_button_f1gender">Log out</string>   <string name="com_facebook_loginview_log_out_button_m2gender">Log out</string>   <string name="com_facebook_loginview_logged_in_as_f1gender">Logged in as</string>   <string name="com_facebook_loginview_logged_in_as_m2gender">Logged in as</string>   <string name="com_facebook_loginview_logged_in_using_facebook_f1gender">Logged in using Facebook</string>   <string name="com_facebook_loginview_logged_in_using_facebook_m2gender">Logged in using Facebook</string>   <string name="com_facebook_send_button_text_f1gender">Send</string>   <string name="com_facebook_send_button_text_m2gender">Send</string>   <string name="com_facebook_share_button_text_f1gender">Share</string>   <string name="com_facebook_share_button_text_m2gender">Share</string>   <string name="com_facebook_smart_login_confirmation_cancel_f1gender">Cancel</string>   <string name="com_facebook_smart_login_confirmation_cancel_m2gender">Cancel</string>   <string name="com_facebook_smart_login_confirmation_continue_as_f1gender">Continue</string>   <string name="com_facebook_smart_login_confirmation_continue_as_m2gender">Continue</string>   <string name="com_facebook_smart_login_confirmation_title_f1gender">Confirm</string>   <string name="com_facebook_smart_login_confirmation_title_m2gender">Confirm</string>   <string name="com_facebook_tooltip_default_f1gender">Default</string>   <string name="com_facebook_tooltip_default_m2gender">Default</string> </resources> 

Not sure whether the above "default translations" make sense, but I never saw them anyway. (The warnings were a result of a cordova plugin that I didn't want to mess with).



回答3:

Xamarin.Facebook.Android 4.26.0 solved the problem



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!