V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
rongchangpig
V2EX  ›  Android

Android studio 编译项目遇到的一些问题

  •  
  •   rongchangpig · 2018-05-24 11:48:27 +08:00 · 10056 次点击
    这是一个创建于 2405 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Android 开发初尝试,尝试编译遇到问题 avatar

    Error retrieving 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);
        }
      });
    
    }
    

    }

    3 条回复    2018-05-24 12:36:15 +08:00
    KNOX
        2
    KNOX  
       2018-05-24 12:13:39 +08:00 via Android
    repository 有没有 google?
    cs923
        3
    cs923  
       2018-05-24 12:36:15 +08:00 via Android
    遇到这种错误直接复制去 stackoverflow 搜索,90%都能找到答案
    ps:用 AS 总会遇到很多奇奇怪怪的问题,做好心理准备
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1371 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 17:19 · PVG 01:19 · LAX 09:19 · JFK 12:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.