2017-02-10 37 views
0

在Android中当我运行的应用程序它触发此错误:Android的晶圆厂图标找不到类“android.graphics.drawable.RippleDrawable”

Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering 

错误火灾时,我取消这些线路:

fabAddLocation = (FloatingActionButton) findViewById(R.id.fab_add_location); 

     fabAddLocation.setOnClickListener(new View.OnClickListener() { 
      public void onClick(View v) { 
       ... 
      } 
     }); 

我认为这可能是兼容性问题。我使用下面的支持库:

compile 'com.android.support:appcompat-v7:25.1.0' 
compile 'com.android.support:support-v4:25.1.0' 
compile 'com.android.support:design:25.1.0' 
compile 'com.android.support:recyclerview-v7:25.1.0' 
compile 'com.android.support:cardview-v7:25.1.0' 

而在模块的build.gradle thise配置:

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.mypackage.myproj" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 

活动延伸AppCompatActivity活动的

XML布局:

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/main_content" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="....MainActivity"> 

    <fragment 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:name="com.google.android.gms.maps.MapFragment" 
     android:id="@+id/mapFragment" /> 

    <android.support.design.widget.FloatingActionButton 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom|right" 
     android:layout_margin="10dp" 
     android:src="@mipmap/ic_add_fab" 
     app:layout_anchor="@id/mapFragment" 
     android:id="@+id/fab_add_location" 
     app:layout_anchorGravity="bottom|left|end" /> 


</android.support.design.widget.CoordinatorLayout> 
+0

请张贴在这个工厂被定义或创建的XML布局文件。 –

+0

@AuuragSingh我用XML更新了这个问题 – Marzouk

+0

你可以把android:src =“@ mipmap/ic_add_fab”改成android:src =“@ drawable/some.png”。请让我知道发生了什么。 –

回答

0

尝试在您的build.gradle(模块:应用程序)文件defaultConfig文件中添加multiDexEnabled true并重建项目。

+0

发生同样的错误 – Marzouk

0

也许你插入MDPI华电国际xxdpi ..与Android工作室资产图像工具图标.. 这是我的问题

相关问题