小编use*_*020的帖子

Gradle Build Error:无法从https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml加载Maven元数据

我在Android Studio中遇到了gradle构建错误,如下所示:

    Error:A problem occurred configuring project ':MyApp'.
    Could not resolve all dependencies for configuration ':MyApp:classpath'.
    Could not resolve io.fabric.tools:gradle:1.+.     
Required by:
    sw-android:MyApp:unspecified
    Failed to list versions for io.fabric.tools:gradle.
        Unable to load Maven meta-data from     
    https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml.
     Could not GET 'https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml'.
    peer not authenticated
        Failed to list versions for io.fabric.tools:gradle.
        Unable to load Maven meta-data from  
        http://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml.
        Could not GET http://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml'.
        peer not authenticated
Run Code Online (Sandbox Code Playgroud)

我发现"https"标签无法下载Maven URL,所以我在我的build.gradle文件中将https更改为http.此外,我检查了所有gradle设置并手动修改路径C:\ Users\Ashfaque1.AndroidStudio\config\options \中的other.xml文件,但仍然采用https://repo1.maven.org/maven2/io /fabric/tools/gradle/maven-metadata.xml.此外,一旦我点击浏览器的这个链接,我得到404异常,但错误的第二个URL http://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml,我能够成功点击并在我的系统中正确下载元数据文件.无法理解问题所在,我需要更改设置以便下载元数据文件.请建议我是否需要更改任何设置或更改此URL的位置 https://repo1.maven.org/maven2//io/fabric/tools/gradle/maven-metadata.xml

我的build.gradle文件如下:

    apply plugin: 'com.android.application'
    apply plugin: 'io.fabric' …
Run Code Online (Sandbox Code Playgroud)

java android maven android-studio android-gradle-plugin

12
推荐指数
2
解决办法
3万
查看次数

如果从超链接打开,应用程序将启动两次

我正在开发一个应用程序,可以从多个位置启动,例如日历中的超链接。我在以下场景中遇到问题:如果应用程序已启动并在后台运行,并且用户单击本机日历中的事件/超链接来启动应用程序。我的应用程序作为新实例启动两次。在正在运行的应用程序列表中,我可以看到应用程序的两个实例。我已经为我的主要活动尝试了 android:launchMode="singleInstance" 和 "singleInstance" 属性,但仍然不起作用。有人可以建议我解决方案吗?

我的清单如下所示:

<application
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity android:name="com.org.ManishApp" 
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" 
android:launchMode="singleInstance">
<intent-filter>`enter code here`
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

android android-manifest

5
推荐指数
1
解决办法
1159
查看次数