某些设备中的应用程序因此错误而崩溃..java.lang.NoClassDefFoundError:com.google.android.gms.R $ string

时间:2016-02-04 07:11:41

标签: android google-maps google-play-services

我的应用程序在除一些三星设备之外的所有设备中运行.. 这些设备提供异常

<?php $custmlogin= new Mage_Customer_Block_Form_Login();?>
<form action="<?php echo $custmlogin->getPostActionUrl() ?>" method="post" id="login-form">
Email:<input type="text" name="login[username]" value="<?php echo   $this->htmlEscape($this->getUsername()) ?>"  title="<?php echo $this->__('Email Address') ?>" />
Password:<input type="password" name="login[password]" id="pass" title="<?php echo $this->__('Password') ?>" />
<button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
</form>

我正在使用这种依赖 -

java.lang.NoClassDefFoundError: com.google.android.gms.R$string

3 个答案:

答案 0 :(得分:4)

我得到的解决方案不是游戏服务。它是棒棒糖前设备中的多指标错误。

在build.gradle中添加了mutidex依赖项。

答案 1 :(得分:0)

根据site, 您需要将以下@Override方法添加到扩展Application的类:

public class FirebaseCntx extends Application {
    ...
    @Override
    protected void attachBaseContext(Context base) {

        super.attachBaseContext(base);
        MultiDex.install(this);
    }
    ...
}

答案 2 :(得分:0)

我在三星标签4.4.2设备中遇到了同样的问题。问题不在于谷歌播放服务。这是因为在Gradle脚本中启用了multidex支持,但忘记更新AndroidManifest.xml。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp">
    <application
            android:name="android.support.multidex.MultiDexApplication" >
        ...
    </application>
</manifest>

android:name 添加到清单文件后解决。