Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class io.netty.channel.epoll.AbstractEpollChannel found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$1 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$2 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$2 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$3 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class io.netty.channel.epoll.AbstractEpollChannel found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$1 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$2 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$2 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$3 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class io.netty.channel.epoll.AbstractEpollChannel found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$1 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$2 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$2 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
     Duplicate class io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$3 found in modules jetified-netty-transport-native-epoll-4.1.67-linux-x86_64.Final-linux-x86_64 (io.netty:netty-transport-native-epoll:4.1.67.Final) and jetified-netty-transport-native-epoll-4.1.67.Final (io.netty:netty-transport-native-epoll:4.1.67.Final)
:
:
:
:
:
:

 

対応方法は以下

build.gradle

implementation( group: 'io.appium', name: 'java-client', version: '8.0.0-beta') {
    exclude group: 'io.netty', module: 'netty-transport-native-epoll'
    exclude group: 'io.netty', module: 'netty-transport-native-kqueue'
    exclude group: 'commons-logging', module: 'commons-logging'
}

基本的な考え方

io.netty:netty-transport-native-epoll

Dupulicate したグループとモジュールを指定して取り除く

group: io.netty

module : netty-transport-native-epoll

appium desktop を起動してサーバを起動

appium inspector を起動

iOS

{
  "platformName": "iOS",
  "appium:udid": "0943D45A-B772-4C36-B738-2931C093D6F1",
  "appium:deviceName": "iPhone",
  "appium:platformVersion": "15"
}

Android

{
  "platformName": "Android"
}

Xcode を起動してプロジェクトを開く

Product  -> show build folder in finder から app ファイルを取得する

 

 

 

Appuim で Android のスクリーンキャプチャーを取るには?

index.js

const driver = require("webdriverio");
const assert = require("assert");

const opts = {
  path: '/wd/hub',
  port: 4723,
  capabilities: {
    platformName: "Android",
    platformVersion: "12",
    deviceName: "Android Emulator",
    app: "/Users/falco/Downloads/ApiDemos-debug.apk",
    appPackage: "io.appium.android.apis",
    appActivity: ".view.TextFields",
    automationName: "UiAutomator2"
  }
};


async function main () {
  const client = await driver.remote(opts);
  await pauseSec(5)

  // Screen shot を取る
  client.saveScreenshot("first.png");

  const field = await client.$("android.widget.EditText");
  await field.setValue("Hello World!");
  await pauseSec(5)
  await field.setValue("Hello World!!!!!!");
  const value = await field.getText();
  assert.strictEqual(value,"Hello World!");

  await pauseSec(5)


  await client.deleteSession();
}

async function pauseSec(timeSec) {
  console.log("Start pauseSec")
  await new Promise(r => setTimeout(r, timeSec * 1000));
  console.log("End")
}

main();

node index.js

デモ用アプリ

https://github.com/appium/appium/raw/master/sample-code/apps/ApiDemos-debug.apk

adbc.sh

#!/bin/bash
FILE_NAME=`date +%Y%m%d_%H_%M_%S`.png
echo $FILE_NAME

adb shell screencap -p /sdcard/$FILE_NAME
adb pull /sdcard/$FILE_NAME
adb shell rm /sdcard/$FILE_NAME

コマンドラインから実行して日時のファイル名でキャプチャーを取得する

© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha