我正在尝试为一个使用蓝牙通信的应用程序启动一个颤振项目。我用的是颤振蓝。

不幸的是,当试图运行(在Android设备上)我创建的第一个示例时,我遇到了以下错误:

FAILURE: Build failed with an exception.

  * What went wrong:
  Execution failed for task ':app:processDebugManifest'.
  > Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:flutter_blue] /home/maldus/Projects/flutter/polmac/build/flutter_blue/intermediates/manifests/full/debug/AndroidManifest.xml as the library might be using APIs not available in 16
    Suggestion: use a compatible library with a minSdk of at most 16,
            or increase this project's minSdk version to at least 19,
            or use tools:overrideLibrary="com.pauldemarco.flutterblue" to force usage (may lead to runtime failures)

如果我在Android Studio,我知道如何提升Android minSdkVersion,但在一个flutter项目(使用VSCode),我有点迷失。

是否有可能增加minSdkVersion与颤振,以及如何?

有人能发布一个通过终端设置ANDROID_HOME的工作解决方案吗?

我到Android-SDK的路径是/Applications/ADT/sdk。

我知道这是一个非常基本的问题,但令我惊讶的是,我找不到任何关于Android SDK构建工具的文档。 除了Android SDK Tools和Android SDK Platform-tools,还有一堆Android SDK Build-tools,如图所示。有没有人能指出一个来源来解释所有这些,并帮助澄清一个特定版本的Android SDK构建工具是如何被选择使用的?

编辑(2014-02-27):

我仍然没有完全理解所有的工具。以下是我根据谷歌最新的资料所作的有限了解:

Android SDK Build-tools used to be components of Android SDK Platform-tools. They have been decoupled from Android SDK Platform-tools, so that the build tools can be updated independently of the integrated development environment (IDE) components. Android SDK Platform-tools are customized to support the features of the latest Android platform. They are backward compatible so that you always use the latest update of Android SDK Platform-tools even your app targets older Android platforms. SDK tools are platform independent and are required no matter which Android platform you are developing on.

I still do not understand the rationale of taking Android SDK Build-tools out of Android SDK Platform-tools which has a single instance and is easy to manage the update. The only possible reason that I can think of is that some apps have to rely on older build components to build them. Google's document mentions this, but does not explain why. Looking at the release notes, you will notice that updates of Android SDK Build-tools are primarily for fixing bugs or/add support for new platforms. The only reason that I can think of for some apps to use older versions of Android SDK Build-tools is that they rely on certain bugs of Android SDK Build-tools. These apps would not function normally without being built with these bugs. I wish Google could explain this better by giving one or two examples showing why these bugs in the tools are critical for certain apps.

自从更新到ADT 14,我不能再构建我的项目。它在更新之前构建得很好。

错误:

[2011-10-23 16:23:29 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;
[2011-10-23 16:23:29 - myProj] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;

类似的问题也有报道,我尝试了其中的建议,包括

重新启动Eclipse。 清理项目和重建-禁用“项目->自动生成”选项,然后“清理”和“生成”项目,然后尝试运行。将“自动构建”选项重置为开启 重新安装Android开发者工具 重新安装Eclipse(更新到最新版本3.7.1) 创建一个从文件系统导入的新项目 从subversion创建一个新项目。

我在jitpack中得到这个错误,我已经在互联网上尝试了一切。以下是我的错误

Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-26 Android SDK Platform 26
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.

当我运行。/sdkmanager——licenses

 All SDK package licenses accepted.======] 100% Computing updates...             

使用sudo和上面的命令得到

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    ... 5 more

附加错误日志

File /opt/android-sdk-linux/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 28.0.3 in /opt/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 26 in /opt/android-sdk-linux/licenses
Warning: License for package Android SDK Platform 26 not accepted.

我不知道为什么它检查许可证,当我的sdk位置是其他

因为gradle android插件2.2-alpha4:

Gradle会尝试下载项目中缺失的SDK包 取决于

这非常酷,是杰克·沃顿的一个项目。

但是,要下载SDK库,你需要:接受许可协议,否则gradle会告诉你:

您还没有接受以下SDK的许可协议 组件:[Android SDK Build-Tools 24, Android SDK Platform 24]。 在构建项目之前,您需要接受许可证 协议并完成缺少组件的安装 使用Android Studio SDK管理器。或者,学习如何 将许可证协议从一个工作站转移到另一个工作站,转到 http://d.android.com/r/studio-ui/export-licenses.html

这是一个问题,因为我想在做gradle构建时安装所有的sdk依赖。

我正在寻找一个解决方案,自动接受所有的许可证。也许是一个gradle脚本? 你有什么想法吗?

我下载了最新的Android SDK工具24.4.1版本。我使用命令行安装sdk。有人问我时,我输入了y

您是否接受许可证'android-sdk-license-c81a61d9' [y/n]: y 安装成功之后。

但是当使用Gradle 3.1进行构建时,会显示如下内容

您没有接受以下SDK组件的许可协议: [Android SDK Platform 23, Android SDK Build-Tools 23.0.1]。 在构建项目之前,您需要接受许可协议,并使用Android Studio SDK管理器完成缺失组件的安装。 或者,要了解如何将许可协议从一个工作站转移到另一个工作站,请访问http://d.android.com/r/studio-ui/export-licenses.html

我检查了~/。android和android工具所在的/opt/android-sdk。两者都不包含名为license的文件夹。

我刚刚下载并安装了新的Android SDK。我想创建一个简单的应用程序来测试它。

向导创建了以下代码:

package eu.mauriziopz.gps;

import android.app.Activity;
import android.os.Bundle;

public class ggps extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

但是Eclipse给出了错误

R不能被分解

在网上

setContentView(R.layout.main);

Why?

PS:我在res/layout/下有一个名为main.xml的XML文件。