Giter Site home page Giter Site logo

android-sdk's People

Contributors

imanx avatar mohammadnr2817 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-sdk's Issues

error with gradle build after adding zarinpal dependency.

Describe the bug
when I add implementation("com.zarinpal:payment-provider:0.6.3") to my app module build.gradle file, and then I sync the project, then when I wanna build project with gradle and run the app on my phone, I get this errors: "

Task :app:processDebugMainManifest FAILED
Task :app:processDebugMainManifest FAILED
[androidx.versionedparcelable:versionedparcelable:1.1.1] C:\Users\tak.gradle\caches\transforms-3\bf96592ba930f3c835d60e99cdda9b4c\transformed\versionedparcelable-1.1.1\AndroidManifest.xml Warning:
[androidx.versionedparcelable:versionedparcelable:1.1.1] C:\Users\tak.gradle\caches\transforms-3\bf96592ba930f3c835d60e99cdda9b4c\transformed\versionedparcelable-1.1.1\AndroidManifest.xml Warning:
Namespace 'androidx.versionedparcelable' is used in multiple modules and/or libraries: androidx.versionedparcelable:versionedparcelable:1.1.1, com.android.support:versionedparcelable:28.0.0. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
Namespace 'androidx.versionedparcelable' is used in multiple modules and/or libraries: androidx.versionedparcelable:versionedparcelable:1.1.1, com.android.support:versionedparcelable:28.0.0. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
C:\Users\tak\AndroidStudioProjects\Digikala\app\src\main\AndroidManifest.xml:28:18-86 Error:
C:\Users\tak\AndroidStudioProjects\Digikala\app\src\main\AndroidManifest.xml:28:18-86 Error:
Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.12.0] AndroidManifest.xml:28:18-86
Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.12.0] AndroidManifest.xml:28:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:8:5-30:19 to override.
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:8:5-30:19 to override.

See https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.
See https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.

Execution failed for task ':app:processDebugMainManifest'.

Manifest merger failed with multiple errors, see logs

  • 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.
BUILD FAILED in 26s
12 actionable tasks: 4 executed, 8 up-to-date

but if I remove the dependency and sync my project without zarinpal dependency, every thing in my project works fine. so what should I do to fix that issue and be able to use zarinpal in my project without any error?
".

Information
my build.gradle.kts(:app) file:

import java.util.Properties

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp")
id("com.google.dagger.hilt.android")
}

val apiKeyPropertiesFile: File = rootProject.file("key.properties")
val apiKeyProperties = Properties()
apiKeyProperties.load(apiKeyPropertiesFile.inputStream())

android {
namespace = "com.example.digikala"
compileSdk = 34

defaultConfig {
    applicationId = "com.example.digikala"
    minSdk = 24
    targetSdk = 34
    versionCode = 1
    versionName = "1.0"

    buildConfigField("String", "X_API_KEY", apiKeyProperties.getProperty("X_API_KEY"))
    buildConfigField("String", "KEY", apiKeyProperties.getProperty("KEY"))
    buildConfigField("String", "IV", apiKeyProperties.getProperty("IV"))

    testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    vectorDrawables {
        useSupportLibrary = true
    }
}

buildTypes {
    release {
        isMinifyEnabled = true
        isShrinkResources = true
        proguardFiles(
            getDefaultProguardFile("proguard-android-optimize.txt"),
            "proguard-rules.pro"
        )
    }
}
compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = "1.8"
}
buildFeatures {
    compose = true
    buildConfig = true
}
composeOptions {
    kotlinCompilerExtensionVersion = "1.5.1"
}
packaging {
    resources {
        excludes += "/META-INF/{AL2.0,LGPL2.1}"
    }
}

}

dependencies {

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

// retrofit
implementation ("com.squareup.retrofit2:retrofit:2.9.0")
implementation ("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

//room db
implementation("androidx.room:room-runtime:2.6.1")
annotationProcessor("androidx.room:room-compiler:2.6.1")
ksp("androidx.room:room-compiler:2.6.1")
implementation("androidx.room:room-ktx:2.6.1")
/*implementation("androidx.room:room-paging:2.6.1")*/

//data store
implementation("androidx.datastore:datastore-preferences:1.0.0")

// dagger hilt with ksp
implementation("com.google.dagger:hilt-android:2.48")
/*ksp("com.google.dagger:hilt-android-compiler:2.48")
ksp ("androidx.hilt:hilt-compiler:1.2.0")*/
implementation ("androidx.hilt:hilt-navigation-compose:1.2.0")
ksp ("com.google.dagger:dagger-compiler:2.48") // Dagger compiler
ksp ("com.google.dagger:hilt-compiler:2.48")   // Hilt compiler

//compose navigation
implementation("androidx.navigation:navigation-compose:2.7.7")

//Gson
implementation ("com.google.code.gson:gson:2.10.1")

//lottie animation
implementation ("com.airbnb.android:lottie-compose:6.3.0")

//coil - load image from url
implementation("io.coil-kt:coil-compose:2.6.0")

//swipe refresh
implementation ("com.google.accompanist:accompanist-swiperefresh:0.27.0")

//system ui controller
implementation ("com.google.accompanist:accompanist-systemuicontroller:0.28.0")

//Accompanist-Pager
implementation ("com.google.accompanist:accompanist-pager:0.35.0-alpha")
implementation ("com.google.accompanist:accompanist-pager-indicators:0.35.0-alpha")

//zarinpal
implementation("com.zarinpal:payment-provider:0.6.3")

}:

Additional context
my Manifest file: "

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
    android:name=".App"
    android:allowBackup="true"
    android:dataExtractionRules="@xml/data_extraction_rules"
    android:fullBackupContent="@xml/backup_rules"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.Digikala"
    tools:targetApi="31">
    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:label="@string/app_name"
        android:theme="@style/Theme.Digikala">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
".

**Your Suggestion for fixing

بازگشت به اپ بعد از خرید

سلام من تو پروژه ام از معماری mvvm استفاده کردم
و launchbillingflow رو توی View Model نوشتم .توی یکی از فرگمنت هام.و اینکه بعد از خرید هم url call back رو به سمت سایتی نمیزنم و میخوام وارد برنامه شم پس براش توی منیفست schema رو تعریف کردم . منتهی بعد از پرداخت موفق توسط کاربر وقتی دکمه برگشت به صفحه پذیرنده رو میزنه دیگه متد onComplete صدا زده نمیشه که اپ بفهمه خرید انجام شده و کاراش رو جلو ببره.به عبارتی اپ دوباره create میشه و برنمیگرده به همون فرگمنتم که کارای بعد خرید رو ببرم جلو .متد onComplete وقتی صدا زده میشه که بعد پرداخت موفق بعدش کاربر دکمه back رو بزنه نه برگشت به صفحه پذیرنده.

Callback

Callback URL: A valid URI or URL Address for sending result purchase.
نمیخوام برگرده به وب ، میخواییم برگرده به خود اپ - و اونجا نتیجه پرداخت رو بگیریم .
خودتون صفحه وب پیشفرض ندارین ، که بره اون داخل و اون صفحه ارسالش کنه به اپ ما ؟

Can not add skd dependencies in my app

Describe the bug
I want to use Zarinpal SDK in my application to get access to the payment gateway.
For this purpose, I have added the below lines in my app build.gradle:

dependencies {
....
implementation "com.zarinpal:mpg:$zarinpal_sdk_version"
implementation "com.zarinpal:payment-provider-ktx:$zarinpal_sdk_version"
implementation "com.zarinpal:payment-provider:$zarinpal_sdk_version"
}

and also in the project build.gradle I have added below lines:

buildscript {
    ext {
      ....
        zarinpal_sdk_version = '0.6.2'
    }
    .....
}

I can sync gradle successfully but when I build my application, I am getting the below error:

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform emoji2-views-helper-1.4.0-alpha01.aar (androidx.emoji2:emoji2-views-helper:1.4.0-alpha01) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Could not find emoji2-views-helper-1.4.0-alpha01.aar (androidx.emoji2:emoji2-views-helper:1.4.0-alpha01).
        Searched in the following locations:
            https://dl.google.com/dl/android/maven2/androidx/emoji2/emoji2-views-helper/1.4.0-alpha01/emoji2-views-helper-1.4.0-alpha01.aar

Information

  • Android OS Version: API 33 emulator
  • Library Version: 0.6.2

Additional context
I have tried to build with VPN and without it. It's no different.

Your Suggestion for fixing
No idea :)

اتصال به درگاه پرداخت

سلام من با aide میخوام اپلیکیشن رو متصل کنم به درگاه پرداخت زرین پال . لطفا راهنمایی کنید . نمونه کد ها رو میخوام . تشکر

can't open Payment gateway

this is my android studio manifest :
Capture

and my Fragment code :
Capture2

I have also received requisites such as internet access but these codes do not work and only show the price.
When I apply for payment, only Progress is displayed and it gets stuck at this stage :

Screenshot_۲۰۲۱۱۰۲۳-۱۷۲۳۰۲_MiniProject
Screenshot_۲۰۲۱۱۰۲۳-۱۷۲۳۱۳_MiniProject

Payment Bug

This is my code:
Screenshot (277)
and this my manifest:
Screenshot (278)

and usesCleartextTraffic = true
But result:
imagee

Duplicate class androidx.lifecycle.ViewModelLazy // Duplicate class androidx.lifecycle.ViewTreeViewModelKt

شرح مشکل
زمانی که کتابخانه ورژن implementation 'com.zarinpal:payment-provider:0.6.3' اد میشود موقعی که برای تست میخواهیم اپلیکیشن ران بگیریم
ارور های زیر را میدهد

Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.0-runtime(androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)
Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)

SDK اپلیکیشن ما
compileSdk 34
minSdk 21
targetSdk 34

این مشکل برای بقیه کاربران هم در نسخه 0.6.2 وجود داشته است!!!
خواهشا راه حلی برای آن ارائه دهید متشکرم

دریافت شماره تلفن بعد از انجام خرید

بعد از انجام
client.launchBillingFlow
و گرفتن موفقیت آمیز
Receipt receipt = task.getSuccess();
هیچ اطلاعاتی در مورد شماره تلفن وارد شده کاربر در دسترس نیست
purchase.toSerialize();
هم چک کردم فقط کد محصول هست و بقیه اطلاعات محصول
امکانش هست شماره تلفنی که کاربر قبل از ورود به صفحه بانک وارد کرده رو، بعد از خرید دریافت کرد؟

بازگشت اطلاعات

سلام من همه این کارا رو انجام دادم خرید هم انجام میشه ولی اطلاعات خرید به داخل اپ برگشت داده نمیشه باید چیکار کنم لطفا راهنمایی کنید
ممنون

BottomSheetBehavior Error

Hello!

Describe the bug
layout/design_bottom_sheet_dialog: Could not inflate Behavior subclass android.support.design.widget.BottomSheetBehavior

This error occurred while running client.launchBillingFlow ...
Please guide me.

Information

  • Android OS Version: 10
  • Library Version: 0.5.4

نصب کتابخانه

سلام من قسمت اولی که گفتید اضافه کنیم
ext.zarinpalSdkVersion = (LATEST_VERSION_REALEASE) //inform of Releases: https://github.com/ZarinPal/Android-SDK/releases
در آپدیت جدید اندروید استادیو جایی به نام all project ندارم
دقیقا کجا باید بنویسم این کد رو
و آیا جای zarinpalSdkVersion چیز دیگه ای باید بنویسم ؟؟

Duplicate class androidx.lifecycle.ViewModelLazy

Describe the bug
Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)

Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)

Information

  • Android OS Version: 13
  • Library Version: 0.6.2

ClassCastException in java

Describe the bug
casting problem

Information

  • Android OS Version: all versions
  • Library Version: 0.6.3

Additional context
java.lang.ClassCastException: kotlin.Result$Failure cannot be cast to kotlin.Result
at com.zarinpal.provider.view.fragments.payment.ShetabPaymentProviderFragment$onViewCreated$1$$ExternalSyntheticLambda0.onChanged(Unknown Source:2)
at com.zarinpal.provider.core.future.SingleLiveEvent.observe$lambda-0(SingleLiveEvent.kt:20)

**Your Suggestion for fixing

sdk doesn't work when init by Authority

Describe the bug
When Authority is created as a server, SDK can not callback to my app
one another question, I need authority after creating where do I access it?

Information

  • Android OS Version: 13
  • Library Version: 0.6.2

Additional context

**Your Suggestion for fixing

BottomSheetBehavior error

Describe the bug
BottomSheetBehavior error in LauncherActivity
Capture

Information

  • Android OS Version: 22
  • Library Version: 0.5.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.