我将Android Studio更新为3.0后,我对某些第三方库出现以下错误:
错误:(30)错误:未知元素< android.widget.TextClock>找到。 错误:(140)错误:未知元素< com.dlazaro66.qrcodereaderview.QRCodeReaderView>找到。
我试图检查此实现的任何新语法,但我在https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#aapt2
找不到任何语法这是我的manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.devtt.ttb.encantt"
android:installLocation="auto"
android:versionCode="32"
android:versionName="2.31" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="24" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:required="true" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:required="true" />
<uses-permission
android:name="android.permission.CAMERA"
android:required="true" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<application
android:allowBackup="true"
android:debuggable="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:testOnly="true"
android:theme="@style/AppTheme" >
<activity
android:name="com.devtt.ttb.encantt.LoginActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.clientSummaryActivity"
android:label="Resumo do Cliente" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.daySummaryActivity"
android:label="EncanT.T." >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.editClientActivity"
android:label="Editar Cliente"
android:windowSoftInputMode="adjustResize|stateAlwaysHidden" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.saleSummaryActivity"
android:label="Detalhe da Venda" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.saleCommentActivity"
android:label="Detalhe da Venda" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.searchActivity"
android:label="Buscar Clientes" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.optionsActivity"
android:label="EncanT.T" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.verifyQrActivity"
android:label="EncanT.T" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.viewCostumer2Activity"
android:label="EncanT.T" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.searchCommentActivity"
android:label="EncanT.T" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.devtt.ttb.encantt.preSearchActivity"
android:label="EncanT.T" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<com.dlazaro66.qrcodereaderview.QRCodeReaderView
android:id="@+id/qrdecoderview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity android:name="com.devtt.ttb.encantt.DecoderActivity" />
<provider
android:name="com.android.tools.ir.server.InstantRunContentProvider"
android:authorities="com.devtt.ttb.encantt.com.android.tools.ir.server.InstantRunContentProvider"
android:multiprocess="true" />
</application>
</manifest>
和app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.devtt.ttb.encantt"
minSdkVersion 15
targetSdkVersion 24
versionCode 32
versionName '2.31'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
api 'com.android.support:appcompat-v7:24.2.1'
api 'com.android.support:design:24.2.1'
testCompile 'junit:junit:4.12'
api 'com.koushikdutta.ion:ion:2.+'
api 'com.yalantis:ucrop:2.2.0'
api 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.2'
api 'joda-time:joda-time:2.9.4'
}
答案 0 :(得分:2)
它确实在错误消息中说明了您发布的内容,错误是什么。
有了名字和一切。
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<nav class="col-md-12 navbar" role="navigation">
<button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="container">
<div id="navbarCollapse" class="collapse navbar-collapse">
<ul class="nav nav-justified main-nav">
<li class="menu-item current-menu-item"><a href="#">Home</a></li>
<li class="menu-item submenu"><a href="#">Submenu</a>
<ul>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
这是一个视图,用于布局XML文件。它不应该在清单中。
答案 1 :(得分:1)
佩德罗,你似乎是新手的
<com.dlazaro66.qrcodereaderview.QRCodeReaderView
android:id="@+id/qrdecoderview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
此代码永远不会显现。
清单文件向Android系统提供有关您的应用程序的基本信息,系统在运行任何应用程序代码之前必须具备这些信息。
您的错误只是这样说,所以您可以解决此问题。
未知元素&lt; com.dlazaro66.qrcodereaderview.QRCodeReaderView&gt; 找到。