小编Ric*_*rdo的帖子

Android studio在哪里是gradle.properties文件?

我正在尝试生成一个签名的apk但我总是得到相同的错误.

To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
Run Code Online (Sandbox Code Playgroud)

我无法归档该文件,但我尝试修改gradle-wrapper.properties但我仍然得到同样的错误.

这是我的gradle-wrapper.properties文件

#Thu May 05 20:51:44 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
org.gradle.jvmargs=-Xmx2048m
Run Code Online (Sandbox Code Playgroud)

我已经尝试过Android Gradle无法为对象堆预留足够的空间

android android-studio android-gradle-plugin

80
推荐指数
3
解决办法
7万
查看次数

jitpack.io无法解析github repo

我有一个Github repo并在其上推送标签.

这是我主要项目的gradle文件.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "dropbox.ric.es.myapplication"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    //mavenCentral()
    //jcenter()

    maven { url "https://jitpack.io" }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.github.rchampa:DropboxHttpConector:1.0.1'
}
Run Code Online (Sandbox Code Playgroud)

但是当我同步gradle时,我有以下错误 Failed to resolve com.github.rchampa:DropboxHttpConector:1.0.1

另一种尝试:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

dependencies …
Run Code Online (Sandbox Code Playgroud)

git android github jitpack

41
推荐指数
4
解决办法
2万
查看次数

html - 在代码标记中显示新行

我正在尝试显示代码,但所有内容都显示在一行中.如何显示多行代码标签?

这是我的代码:

的index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<title>Documentación: Events</title>
<body>
<code>
    {
    "id_tabla":3,
    "fecha":"02-09-2015",
    "privacidad":0,
    "timediff_m": "00"
    }
</code>
</body>
Run Code Online (Sandbox Code Playgroud)

这是如何在浏览器中显示:

{"id_tabla":3,"fecha":"02-09-2015","privacidad":0,"timediff_m": "00"}
Run Code Online (Sandbox Code Playgroud)

编辑

我只能使用<code>标签

html5

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

Android 8通知setSound无法正常工作

我有以下代码,但每次我只是听到默认的Android声音.

        // create  channel
        NotificationChannel channel = new NotificationChannel(ANDROID_CHANNEL_ID,
                ANDROID_CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);
        // Sets whether notifications posted to this channel should display notification lights
        channel.enableLights(true);
        // Sets whether notification posted to this channel should vibrate.
        channel.enableVibration(true);
        // Sets the notification light color for notifications posted to this channel
        channel.setLightColor(Color.GREEN);
        // Sets whether notifications posted to this channel appear on the lockscreen or not
        //channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
        channel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);

        Uri uri = Uri.parse("android.resource://"+this.getPackageName()+"/" + R.raw.aperturaabductores);

        AudioAttributes att = new AudioAttributes.Builder()
                .setUsage(AudioAttributes.USAGE_NOTIFICATION)
                .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
                .build();
        channel.setSound(uri,att);
Run Code Online (Sandbox Code Playgroud)

这是我的声音 …

android-notifications android-8.0-oreo

19
推荐指数
2
解决办法
1万
查看次数

AWS - 停止负载均衡器

根据免费等级,我有750h的负载均衡器.我想尝试创建多个负载均衡器.现在我想停止它以避免浪费自由计划.

但我没有找到任何"停止"按钮. 在此输入图像描述

load-balancing amazon-ec2

18
推荐指数
1
解决办法
6394
查看次数

可以在同一个查询中使用运算符"$ ne"和"$ elemMatch"吗?

我试图找到所有文件,tipo=CD而canciones不包含具有title=Pajaritos和的子文档cancion=2

这是我想在canciones现场实现的目标:

not (title=Pajaritos and cancion=2)
Run Code Online (Sandbox Code Playgroud)

我有以下集合:

{ 
    "tipo": "CD",
    "Artista":"Los piratas",
    "Titulo": "Recuerdos",
    "canciones": [
        {
            "cancion":1,
            "titulo":"Adios mi barco",
            "longitud": "3:20"
         },
         {
            "cancion":2,
            "titulo":"Pajaritos",
            "longitud": "4:15"
         }
     ]
},
{ 
    "tipo": "CD",
    "Artista":"Los piratas",
    "Titulo": "Recuerdos",
    "canciones": [
        {
            "cancion":1,
            "titulo":"Adios mi barco",
            "longitud": "3:20"
        },
        {
            "cancion":3,
            "titulo":"Pajaritos",
            "longitud": "4:15" 
        }
    ]
},

{ 
    "tipo": "CD",
    "Artista":"Los piratas",
    "Titulo": "Recuerdos",
    "canciones": [
        {
            "cancion":1,
            "titulo":"Adios mi barco",
            "longitud": "3:20" …
Run Code Online (Sandbox Code Playgroud)

mongodb mongodb-query

11
推荐指数
1
解决办法
7158
查看次数

Android Webview多点触控touchstart事件无法使用超过2个手指

请考虑以下代码:

canvas.addEventListener('touchstart', function(event) {
    console.log('start');
});
Run Code Online (Sandbox Code Playgroud)

当我同时用两根手指敲击时,我有以下输出(因为打印两次很酷):

I/SnapScrollController(26508): setSnapScrollingMode case-default no-op
I/chromium(26508): [INFO:CONSOLE(69)] "start", source: file:///android_asset/index.html (69)
I/chromium(26508): [INFO:CONSOLE(69)] "start", source: file:///android_asset/index.html (69)
Run Code Online (Sandbox Code Playgroud)

但是当我同时使用两个以上的手指时,我的结果相同,我做错了什么?我被期待的日志"开始"与我使用的手指一样多次.

在另一边touchmove,touchend效果很好.

我在这里上传了代码

javascript android multi-touch webview

11
推荐指数
1
解决办法
930
查看次数

NestedScrollView不完整滚动

我正在使用NestedScrollView以达到与此类似的功能.

在此输入图像描述

更新

这是我的回购.

我想出当手机转向风景时,滚动不让我看到按钮或底部的灰色视图.

这是我的 mainlayout.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbarLayout"
        android:layout_width="match_parent"
        android:layout_height="256dp"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:expandedTitleTextAppearance="@style/Toolbar.TitleText"
            app:collapsedTitleTextAppearance="@style/Toolbar.TitleText"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginStart="48dp"
            app:expandedTitleMarginEnd="64dp">

            <ImageView
                android:id="@+id/iv_tipo"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@color/colorPrimary"
                android:fitsSystemWindows="true"
                android:layout_gravity="center"
                app:layout_collapseMode="parallax"
                app:srcCompat="@drawable/aviso_128dp"/>

            <!--<include layout="@layout/toolbar_pin" />-->
            <android.support.v7.widget.Toolbar
                android:id="@+id/myToolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />

            <TextView
                android:id="@+id/tv_toolbar_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"/>

        </android.support.design.widget.CollapsingToolbarLayout>


    </android.support.design.widget.AppBarLayout>

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <!-- A CardView that contains a TextView --> …
Run Code Online (Sandbox Code Playgroud)

android material-design android-coordinatorlayout

9
推荐指数
1
解决办法
275
查看次数

Gradle:compileOnly 和 runtimeOnly

我已经阅读了文档,但我无法理解如何创建一个工作示例以更好地理解它们的差异。

在此处输入图片说明

而且我已经创建了一个游乐场项目来检查当我使用一个或另一个时会发生什么。

应用程序.gradle

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$rootProject.kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    compileOnly project(":compileonlylibrary")
    runtimeOnly project(":runtimeonlylibrary")
}
Run Code Online (Sandbox Code Playgroud)

主活动.kt

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        FooCompile() // this crash in runtime
        BarRuntime() // this doesn't compiles obviously
    }
}
// FooCompile belongs to compileonlylibrary
// BarRuntime belongs to runtimeonlylibrary
Run Code Online (Sandbox Code Playgroud)

就是这样,我被困在这里,我无法创建一个合适的示例来提高我对 Gradle 配置的了解。

有人可以帮我一把吗?如果需要,我可以提供更多详细信息。

android gradle

9
推荐指数
2
解决办法
3414
查看次数

8
推荐指数
2
解决办法
4136
查看次数