-
글쓴이글
-
2024년 12월 8일 15:19 #133681
CHUNGSIN참가자1. 아래 gradle build 오류 메시지로 검색 중 * What went wrong: A problem occurred configuring project ':sqlite3_flutter_libs'. > Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
앞서 문의 한 게시글을 확인하여 동일하게 따라갔습니다.(<a href="https://codingapple.com/forums/topic/namespace-agp-%ec%98%a4%eb%a5%98-%ec%a7%88%eb%ac%b8-%eb%93%9c%eb%a6%bd%eb%8b%88%eb%8b%a4/">링크</a>) 2. build.gradle 내 추천해 주신 아래 문구를 추가 했더니 subprojects { afterEvaluate { project -> if (project.hasProperty('android')) { project.android { if (namespace == null) { namespace project.group } } } } }
다음과 같은 빌드 오류가 발생합니다. * What went wrong: A problem occurred evaluating root project 'android'. > Cannot run Project.afterEvaluate(Closure) when the project is already evaluated. 앞선 게시글에서 이후 조치 사항 [ https://stackoverflow.com/a/71014094 에서 android/app/build.gradle 파일에 한줄 추가하라는것도 해봅시다 ] 에 따라 아래 플러그인을 적용하려 했으나 다음과 같은 오류가 발생합니다. apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
* What went wrong: Plugin [id: 'com.onesignal.androidsdk.onesignal-gradle-plugin'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Plugin Repositories (plugin dependency must include a version number for this source)
적용 내용은 아래와 같습니다. plugins { id "com.android.application" id "kotlin-android" // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id "dev.flutter.flutter-gradle-plugin" id "com.onesignal.androidsdk.onesignal-gradle-plugin" }
-
이 게시글은
CHUNGSIN에 의해 6 월, 1 주 전에 수정됐습니다.
2024년 12월 9일 09:09 #133706
CHUNGSIN참가자pubspec 내 dependencies로 sqlite3_flutter_libs: 0.5.10를 추가한 후에 발생한 오류입니다
2024년 12월 9일 15:43 #133722
CHUNGSIN참가자바쁘신 와중에 답변 감사합니다. 다만 버전을 변경해도 동일한 오류가 발생합니다 ㅠ
* What went wrong: Plugin [id: 'com.onesignal.androidsdk.onesignal-gradle-plugin'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Plugin Repositories (plugin dependency must include a version number for this source) 혹시나 해서 해당 플러그인을 제거하고 빌드 하니 아래와 같은 오류가 발생합니다. * What went wrong: A problem occurred evaluating root project 'android'. > Cannot run Project.afterEvaluate(Closure) when the project is already evaluated. 도움 부탁드립니다 ㅠㅠ
2024년 12월 9일 16:09 #133726
CHUNGSIN참가자앞선 오류를 해결하기 위해 다음과 같이 진행해 보았습니다. 1. android/app/build.gradle에서 id "com.onesignal.androidsdk.onesignal-gradle-plugin" 구문을 삭제하고, android/build.gradle에서 구문 순서를 다음과 같이 적용하였습니다.
subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" }
subprojects { afterEvaluate { project -> if (project.hasProperty('android')) { project.android { if (namespace == null) { namespace project.group } } } } } subprojects { project.evaluationDependsOn(":app") } 2. 이렇게 적용 후 빌드하니 다음과 같은 오류가 발생하였습니다.
* What went wrong: Execution failed for task ':sqlite3_flutter_libs:processDebugManifest'. > A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction > Incorrect package="com.example.sqlite3_flutter_libs" found in source AndroidManifest.xml: C:\Users\SAMSUNG\AppData\Local\Pub\Cache\hosted\pub.dev\sqlite3_flutter_libs-0.5.10\android\src\main\AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="com.example.sqlite3_flutter_libs" from the source AndroidManifest.xml: C:\Users\SAMSUNG\AppData\Local\Pub\Cache\hosted\pub.dev\sqlite3_flutter_libs-0.5.10\android\src\main\AndroidManifest.xml. 3. sqlite3_flutter_libs 버전 충돌인가 하여 기존 버전 0.5.10으로 적용후 다시빌드 했으나 다음과 같은 오류가 발생합니다.
Warning: SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. WARNING: We recommend using a newer Android Gradle plugin to use compileSdk = 34
This Android Gradle plugin (8.1.0) was tested up to compileSdk = 33 (and compileSdkPreview = "UpsideDownCakePrivacySandbox").
You are strongly encouraged to update your project to use a newer Android Gradle plugin that has been tested with compileSdk = 34.
If you are already using the latest version of the Android Gradle plugin, you may need to wait until a newer version with support for compileSdk = 34 is available.
To suppress this warning, add/update android.suppressUnsupportedCompileSdk=34 to this project's gradle.properties.
> Task :sqlite3_flutter_libs:processDebugManifest FAILED Incorrect package="com.example.sqlite3_flutter_libs" found in source AndroidManifest.xml: C:\Users\SAMSUNG\AppData\Local\Pub\Cache\hosted\pub.dev\sqlite3_flutter_libs-0.5.10\android\src\main\AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="com.example.sqlite3_flutter_libs" from the source AndroidManifest.xml: C:\Users\SAMSUNG\AppData\Local\Pub\Cache\hosted\pub.dev\sqlite3_flutter_libs-0.5.10\android\src\main\AndroidManifest.xml.
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':sqlite3_flutter_libs:processDebugManifest'. > A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction > Incorrect package="com.example.sqlite3_flutter_libs" found in source AndroidManifest.xml: C:\Users\SAMSUNG\AppData\Local\Pub\Cache\hosted\pub.dev\sqlite3_flutter_libs-0.5.10\android\src\main\AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="com.example.sqlite3_flutter_libs" from the source AndroidManifest.xml: C:\Users\SAMSUNG\AppData\Local\Pub\Cache\hosted\pub.dev\sqlite3_flutter_libs-0.5.10\android\src\main\AndroidManifest.xml.
* Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 16s 32 actionable tasks: 28 executed, 4 up-to-date 어떻게 적용하는 것이 좋을지 의견 부탁드립니다 ㅠㅠ
2024년 12월 9일 19:21 #133731
codingapple키 마스터다른건 냅두고 패키지만 신버전으로 설치해서 써봅시다 안되면 https://stackoverflow.com/a/72523134 이런 파일에서 gradle버전을 gradle-7.4-all.zip 이런걸로 낮춰봅시다
2024년 12월 9일 19:41 #133733
CHUNGSIN참가자우여곡절 끝에 terminal에서 ./gradlew clean build로는 성공했습니다. 에뮬레이터로 프로젝트를 실행하니 아래와 같은 오류가 발생합니다. ㅠ 이것도 gradle 버전을 낮추면 괜찮을까요?
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Could not resolve all files for configuration ':app:androidJdkImage'. > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JdkImageTransform: C:\Users\SAMSUNG\AppData\Local\Android\sdk\platforms\android-34\core-for-system-modules.jar. > Error while executing process C:\Program Files\Android\Android Studio\jbr\bin\jlink.exe with arguments {--module-path C:\Users\SAMSUNG\.gradle\caches\transforms-3a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\temp\jmod --add-modules java.base --output C:\Users\SAMSUNG\.gradle\caches\transforms-3a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\jdkImage --disable-plugin system-modules}
2024년 12월 10일 09:27 #133753
codingapple키 마스터https://stackoverflow.com/a/79191154 그것도 gradle 버전이나 자바 버전 바꾸면 된다는 소리가 있습니다
2024년 12월 11일 11:42 #133811
CHUNGSIN참가자여러가지 시도 끝에 빌드에 성공했습니다. 다만 다른 라이브러리를 추가하면서 또다른 오류가 발생했습니다 ㅠ 버전정보 - Gradle 8.3 - Kotlin: 1.9.0 - Groovy: 3.0.17 - JVM: 17.0.13 (Oracle Corporation 17.0.13+10-LTS-268) 추가 라이브러리 : pate_provider , 버전 : 2.0.11 or 2.1.2 두가지 모두 아래와 같은 오류가 발생합니다. * What went wrong: Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'. > Could not resolve all files for configuration ':path_provider_android:androidJdkImage'. 해결할 수 있는 방법이 있을까요? 도움 부탁드립니다 ㅠㅠ
-
이 게시글은
-
글쓴이글
- 답변은 로그인 후 가능합니다.