android,kotlin2025. 1. 8. 10:49

[android] 이 작업을 완료하기 위한 페이징 파일이 너무 작습니다 이슈 해결방법

 

[참조] https://ranprog.tistory.com/17

 

[오류] 이 작업을 완료하기 위한 페이징 파일이 너무 작습니다

'이 작업을 완료하기 위한 페이징 파일이 너무 작습니다' 평소처럼 이클립스를 사용하던 중 해당 문구가 나왔다 램 부족으로 해석이 수행되지 않아서 가상메모리/*페이징파일*/를 이용하려는데

ranprog.tistory.com

 

Posted by thdeodls85
flutter2024. 10. 17. 10:30

[flutter] flutter Flutter sdk is not found in the specified location 해결방법

 

android studio 안에서 project 만들려고 하는데, path 설정에서 빈칸으로 뜬다.

 

flutter 설치 확인 되있는데, 안되서 확인해보니, 

 

시스템 -> 고급 -> 환경변수 -> 사용자 변수 , 시스템 변수 안에 path 설정 할때, 

 

flutter/bin 까지 설정할텐데, 두 곳에다가 다 넣어두면 인식한다.

Posted by thdeodls85
android,kotlin2024. 6. 21. 14:55

[android] Android RS232 구현방법

 

gradle

dependencies {
    implementation 'com.github.mik3y:usb-serial-for-android:3.4.6'
}

 

manifest

<uses-feature android:name="android.hardware.usb.host" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.USB_PERMISSION" />

<application
    ...>
    <activity ...>
        ...
        <intent-filter>
            <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
        </intent-filter>
        <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
            android:resource="@xml/device_filter" />
    </activity>
</application>

 

필터

<resources>
    <usb-device vendor-id="0x2341" product-id="0x0043" />
</resources>

 

하드웨어에서 제공하는 키를 넣으면 된다.

vendor-id="0x2341" product-id="0x0043"

 

activity

 private lateinit var usbManager: UsbManager
    private var serialPort: UsbSerialPort? = null
    
     override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        usbManager = getSystemService(USB_SERVICE) as UsbManager
        setupSerialConnection()
    }
    
    private fun setupSerialConnection() {
        val availableDrivers = UsbSerialProber.getDefaultProber().findAllDrivers(usbManager)
        if (availableDrivers.isEmpty()) {
            Log.d(TAG, "No USB devices found")
            return
        }

        val driver = availableDrivers[0]
        val connection = usbManager.openDevice(driver.device)
        if (connection == null) {
            Log.d(TAG, "Could not open connection")
            return
        }

        serialPort = driver.ports[0]
        serialPort?.open(connection)
        serialPort?.setParameters(9600, 8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE)

        val usbIoManager = SerialInputOutputManager(serialPort, object : SerialInputOutputManager.Listener {
            override fun onNewData(data: ByteArray) {
                runOnUiThread {
                    Log.d(TAG, "Received data: ${String(data)}")
                }
            }

            override fun onRunError(e: Exception) {
                Log.e(TAG, "Runner stopped.", e)
            }
        })
        Executors.newSingleThreadExecutor().submit(usbIoManager)

        // Example: Sending data
        val sendData = "하드웨어에 전해줄 명령어".toByteArray()
        serialPort?.write(sendData, 1000)
    }
    
      override fun onDestroy() {
        super.onDestroy()
        serialPort?.close()
    }

 

협약 된 명령어 넣어준다.

 val sendData = "하드웨어에 전해줄 명령어".toByteArray()

Posted by thdeodls85
android,kotlin2024. 6. 4. 15:39

[android] Could not parse metadata! Try bumping kotlinpoet and/or kotlinx-metadata version cohttp://m.squareup.moshi.kotlinpoet 해결방법

 

  kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.14.0'
  
  ->
   kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.15.1'
   
   변경처리한다.

 

 

[참조] https://github.com/square/moshi#codegen

 

GitHub - square/moshi: A modern JSON library for Kotlin and Java.

A modern JSON library for Kotlin and Java. Contribute to square/moshi development by creating an account on GitHub.

github.com

 

<dependency>
  <groupId>cohttp://m.squareup.moshi</groupId>
  <artifactId>moshi-kotlin</artifactId>
  <version>1.15.1</version>
</dependency>

Posted by thdeodls85
android,kotlin2024. 6. 3. 15:24

[android] None of the following candidates is applicable because of receiver type mismatch: public val NamedDomainObjectContainer<Configuration>.implementation: NamedDomainObjectProvider<Configuration> defined in org.gradle.kotlin.dsl 해결방법은?

 

내부 프로젝트 import 시킬려고 했더니...

 

Gradle Kotlin DSL 추천 해서 해봣더니.. 문법이 Groovy DSL 과 다르다.. 적용 시킬려면 제대로 된 문법을 넣으면 된다.

 

예전방식

// 예전방식
implementation project(':프로젝트명')

// dsl방식
implementation(project(":프로젝트명"))

 

 

Posted by thdeodls85
ios,swift2024. 4. 30. 10:09

[iOS] tabbar item click 막는방법

 

tabBar.items![2].isEnabled = false

Posted by thdeodls85
android,kotlin2024. 3. 19. 13:49

[android] 패키지가 잘못되어 앱이 설치되지 않았습니다 해결방법

 

debug 빌드해서 apk 로 발행해 줄려는데.. 설치가 되지 않는다..

 

그럴때는 싸인해서 apk 발행하면 된다.

Posted by thdeodls85
android,kotlin2023. 10. 23. 19:52

[kotlin]signingconfig with name not found android studio

 

다른 글에서 나와있는것처럼 했는데... 안된다..

 

그런데 너무 간단한거다...

 

signningConfigs 순서상 먼저 해주고 buildTypes 설정해야 "release" 찾을 수 있다. 

signingConfigs {
    create("release") {
        storePassword = ""
        keyAlias = ""
        keyPassword = ""
        storeFile = file("")
    }
}

하고나서

 buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )

            signingConfig = signingConfigs.getByName("release")
        }
    }
Posted by thdeodls85