设计布局预览未在Android Studio 3.2.1中加载

时间:2018-10-31 06:36:19

标签: android

Android资源链接失败 输出:

D:\GetDeviceLocation2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
D:\GetDeviceLocation2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
D:\GetDeviceLocation2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:461: error: resource android:attr/fontVariationSettings not found.
D:\GetDeviceLocation2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:462: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: C:\Users\KAMAL\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\1004f9e02d2cf44b39e5208f3f298ce2\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
        C:\Users\KAMAL\AppData\Local\Android\Sdk\platforms\android-27\android.jar\
        --manifest\
        D:\GetDeviceLocation2\app\build\intermediates\instant_run_merged_manifests\debug\processDebugManifest\instant-run\AndroidManifest.xml\
        -o\
        D:\GetDeviceLocation2\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @D:\GetDeviceLocation2\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        D:\GetDeviceLocation2\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        com.mmc.getdevicelocation2\
        -0\
        apk\
        --preferred-density\
        xxhdpi\
        --output-text-symbols\
        D:\GetDeviceLocation2\app\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

enter image description here

2 个答案:

答案 0 :(得分:0)

转到“构建”标签栏android studio。点击“清理并重建项目”之后的构建。

答案 1 :(得分:0)

1-在模块gradle文件中

import scrapy

from scrapy.http import Request


class pwc_tax(scrapy.Spider):
    name = "pwc_tax"

    allowed_domains = ["www.sec.gov", 'search.usa.gov', 'secsearch.sec.gov']
    start_urls = ["https://secsearch.sec.gov/search?utf8=%E2%9C%93&affiliate=secsearch&sort_by=&query=Exhibit+10%2F+EXHIBIT+11"]

    def parse(self, response):
        # extract search results
        for link in response.xpath('//div[@id="results"]//h4[@class="title"]/a/@href').extract():
            req = Request(url=link, callback=self.parse_page)
            yield req

    def parse_page(self, response):
        # parse each search result here
        pdf_files = response.xpath('//div[@class="article-file-download"]/a/@href').extract()
        # base url wont be part of this pdf_files
        # sample: [u'/files/18-03273-E.pdf']
        # need to add at the beginning of each url
        # response.urljoin() will do the task for you
        for pdf in pdf_files:
            if pdf.endswith('.pdf'):
                pdf_url = response.urljoin(pdf)
                req = Request(url=pdf_url, callback=self.save_pdf)
                yield req

    def save_pdf(self, response):
        path = response.url.split('/')[-1]
        self.logger.info('Saving PDF %s', path)
        with open(path, 'wb') as f:
            f.write(response.body)

如果在项目中使用其他模块,请确保compileSdkVersion和targetSdkVersion版本都相同。 (28.x.x)

2-如果没有成功构建gradle,则会发生这种情况。查看此链接:link

3-另一种解决方案是:在菜单

buildToolsVersion **'28.0.3'**
compileSdkVersion **28**
defaultConfig {
    applicationId "com.example.app"
    minSdkVersion 19
    targetSdkVersion **28**
    versionCode 1
    versionName "1.1.0"
    multiDexEnabled false
}

您需要按File -> Invalidate Caches / Restart 按钮。这在许多情况下都很有帮助,尤其是当您从git存储库中提取更改并且有人更改了gradle文件中的库时。