小编Adr*_*des的帖子

无法验证dex:错误的方法句柄类型7

我正在尝试创建一个测试示例,其中我将TextView的内容设置为存储在IPFS中的文件的内容.

我正在使用此存储库来执行我的功能:https://github.com/ipfs/java-ipfs-api

我一直在多个地方看到似乎是多索引错误despit启用multidex:

defaultConfig {
        applicationId "*****"
        minSdkVersion 26
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        **multiDexEnabled true**
    }

dependancies{
    implementation 'com.android.support:multidex:1.0.0'
}
Run Code Online (Sandbox Code Playgroud)

MainActivity.java:

 @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误:

FATAL EXCEPTION: main
                                                                          Process: com.lab1.ac01220.blossom, PID: 20807
                                                                          java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.lab1.ac01220.blossom/com.lab1.ac01220.blossom.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.lab1.ac01220.blossom.MainActivity" on path: DexPathList[[zip file "/data/app/com.lab1.ac01220.blossom-ixLs4xcrmWVVfgtCrH9vpw==/base.apk", zip file "/data/app/com.lab1.ac01220.blossom-ixLs4xcrmWVVfgtCrH9vpw==/split_lib_dependencies_apk.apk", zip file "/data/app/com.lab1.ac01220.blossom-ixLs4xcrmWVVfgtCrH9vpw==/split_lib_slice_0_apk.apk", zip file "/data/app/com.lab1.ac01220.blossom-ixLs4xcrmWVVfgtCrH9vpw==/split_lib_slice_1_apk.apk", zip file "/data/app/com.lab1.ac01220.blossom-ixLs4xcrmWVVfgtCrH9vpw==/split_lib_slice_2_apk.apk", zip file "/data/app/com.lab1.ac01220.blossom-ixLs4xcrmWVVfgtCrH9vpw==/split_lib_slice_3_apk.apk", zip …
Run Code Online (Sandbox Code Playgroud)

android dex ipfs

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

tls:HTTP 请求没有重新协商错误

我正在尝试在 Go 中发出一个简单的 HTTP 请求,在直接按照指南操作后,我不断收到相同的错误:

local error: tls: no renegotiation

我不太明白如何解释这个?我知道这不是服务器上的问题,因为当我从 python 调用相同的请求时,它返回正常。这是我的代码:

package main

import (
    "fmt"
    "net/http"
    "net/url"
    "strings"
    "time"
)

func main() {
    timeout := time.Duration(20 * time.Second)
    client := &http.Client{
        Timeout: timeout,
    }
    data := url.Values{
        "top":   {"10"},
        "lDate": {"2019-01-01"},
    }
    req, err := http.NewRequest("POST", "https://api.*********.com/AppAvailLoads?", strings.NewReader(data.Encode()))
    if err != nil {
        fmt.Println("Error in construction")
    }
    req.Header.Add("x-cdata-authtoken", "********")
    req.Header.Add("content-type", "application/x-www-form-urlencoded")
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error in request")
        fmt.Println(err)
    } else { …
Run Code Online (Sandbox Code Playgroud)

go go-http

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

编辑默认 postgres:12 docker 镜像中的 pg_hba.conf

我正在尝试在标准 postgres:12 docker 映像中启用流复制,这需要更改pg_hba.conf. 我已经设法强制更新postgresql.confvia 使数据库使用它(-c config_file="<>"在 docker-compose 中传递标志而不是通过 init 脚本传递标志)。

但我找不到参数或标志选项来让数据库使用我的数据库pg_hba.conf,尽管尝试在复制到的启动脚本中这样做docker-entrypoint-initdb.d

有任何想法吗?

Docker-compose

version: "2"
services:
  postgres:
    build:
      context: ./docker
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    command:
      - "postgres"
      - "-c"
      - "config_file=/etc/postgresql/postgresql.conf"
    ports:
      - 5432:5433
Run Code Online (Sandbox Code Playgroud)

Dockerfile:

FROM postgres:12
ENV VERSION 1_0
RUN buildDeps="curl build-essential ca-certificates git   pkg-config glib2.0 postgresql-server-dev-$PG_MAJOR" \
    && apt-get update \
    && apt-get install -y --no-install-recommends  ${buildDeps} \
    && echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" …
Run Code Online (Sandbox Code Playgroud)

postgresql shell docker

4
推荐指数
1
解决办法
9443
查看次数

如何使用 Tokio oneshot 发送器和接收器执行具有内循环的不同任务?

不知道如何处理这里的借用检查器。

use tokio::sync::oneshot; // 1.0.2

fn main() {
    let (sender, receiver) = oneshot::channel::<u8>();
    tokio::spawn(async move {
        loop {
            sender.send(3).unwrap();
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

创建此错误:

error[E0382]: use of moved value: `sender`
 --> src/main.rs:7:13
  |
7 |             sender.send(3).unwrap();
  |             ^^^^^^ value moved here, in previous iteration of loop
  |
  = note: move occurs because `sender` has type `tokio::sync::oneshot::Sender<u8>`, which does not implement the `Copy` trait
Run Code Online (Sandbox Code Playgroud)

future rust rust-tokio

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

标签 统计

android ×1

dex ×1

docker ×1

future ×1

go ×1

go-http ×1

ipfs ×1

postgresql ×1

rust ×1

rust-tokio ×1

shell ×1