
Android 开发初尝试,尝试编译遇到问题 
Error etrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. Message{kind=ERROR, text=Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'., sources=[C:\Users\admin.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\1d8531ccbcfb5f99866244a0b7edccc6\res\values-v23\values-v23.xml:4:5-135], original message=, tool name=Optional.of(AAPT)}
Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. Message{kind=ERROR, text=Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'., sources=[C:\Users\admin.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\1d8531ccbcfb5f99866244a0b7edccc6\res\values-v23\values-v23.xml:34:5-105], original message=, tool name=Optional.of(AAPT)}
Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\admin\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\admin\AppData\Local\Android\Sdk\platforms\android-22\android.jar -M \?\E:\HistogramTest\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S E:\HistogramTest\app\build\intermediates\res\merged\debug -m -J \?\E:\HistogramTest\app\build\generated\source\r\debug -F E:\HistogramTest\app\build\intermediates\res\debug\resources-debug.ap_ --custom-package com.example.asus.histogramtest -0 apk --output-text-symbols \?\E:\HistogramTest\app\build\intermediates\symbols\debug --no-version-vectors}
代码贴上:
package com.example.asus.histogramtest;
import android.app.Activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.ViewDebug; import android.widget.Button;
import com.example.asus.histogramtest.DiyView.HistogramView; import com.example.asus.histogramtest.bean.HistogramData;
import java.util.ArrayList;
public class MainActivity extends Activity {
private ArrayList<HistogramData> histogramDatas; //数据 private HistogramView histogramView; //直方图 View @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // histogramView.setVisibility(View.INVISIBLE); histogramDatas = new ArrayList<>(); histogramDatas.add(new HistogramData(6, "6")); histogramDatas.add(new HistogramData(16, "16")); histogramDatas.add(new HistogramData(5.5f, "5.5")); histogramDatas.add(new HistogramData(1.4f, "1.4")); histogramDatas.add(new HistogramData(1.015f, "1.015")); histogramDatas.add(new HistogramData(80, "80")); histogramDatas.add(new HistogramData(1.0f, "1.0")); histogramDatas.add(new HistogramData(33, "33")); histogramDatas.add(new HistogramData(66, "66")); histogramDatas.add(new HistogramData(4.0f, "4.0")); histogramDatas.add(new HistogramData(125, "125")); histogramView = (HistogramView) findViewById(R.id.h); // histogramView.setData(histogramDatas); //Button v=findViewById(R.id.btn); // v.setVisibility(View.INVISIBLE); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //histogramView.setVisibility(View.VISIBLE); histogramView.setData(histogramDatas); // v.setVisibility(View.INVISIBLE); } }); } }
2 KNOX 2018-05-24 12:13:39 +08:00 via Android repository 有没有 google? |
3 cs923 2018-05-24 12:36:15 +08:00 via Android 遇到这种错误直接复制去 stackoverflow 搜索,90%都能找到答案 ps:用 AS 总会遇到很多奇奇怪怪的问题,做好心理准备 |